I wrote a program to read excel files using Apache POI which is working as expected. Next part is to implement - "To reject reading excel file if it contains DDE links/information.I read about DDE information via below links https://en.wikipedia.org/wiki/Dynamic_Data_Exchangehttp://jdde.pretty-tools.com/https://v8doc.sas.com/sashtml/win/z3ples.htmI could not get information on how an excel file looks like with DDE information.to identify an excel file that contains DDE informationIt would be great if someone can help me in understanding the above two points.     Thanks in Advance 解决方案 For XSSF one could get the List of ExternalLinksTables from the XSSFWorkbook using XSSFWorkbook.getExternalLinksTable. Then iterate through that List, get CTExternalLink for each ExternalLinksTable using ExternalLinksTable.getCTExternalLink and then check whether CTExternalLink.isSetDdeLink is true. If so, we have a DDE link there.External links like ='C:\Users\Paul\Documents\[2014 Budget.xlsx]Details'!$R$7 or ='http://teamsite.company.com/corporate/[MySpreadsheet.xlsx]‌​Sheet1'!F4 have nothing to do with DDE. There is no danger while using such links and so no reason to "reject reading excel file if it contains" such links. A DDE link looks like =ddeapp|'parameters'!reference in Excel. So we need to differ DDE links from others and only "reject reading excel file if it contains" really DDE links. Using CTExternalLink.isSetDdeLink we are able to do this differentation.I suspect the requirement "reject reading excel file if it contains DDE links" is about avoiding cell formulas like =ddeapp|'parameters'!reference in Excel. Using such formulas one could do really bad and dangerous things if the user is not attentively and is administrator. Example: =cmd|'/C control'!anyname. This will open system control application in Windows and if the user is administrator, then it would allow much more...Since DDE is ancient technology from neolithic of IT, there are currently no good examples for using DDE in a productive way. You need a ddeapp which is a application which allows contact via DDE and returns a value then. This youtube video: DDE Link Setup for DTN IQFeed shows an example. 这篇关于Excel中的DDE信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-19 17:21