问题
Is it possible to view the source code of the XLL Excel add in without having the original source code? I'm guessing that this XLL was written in C#, but not sure. I.e. a .NET DLL you can decompile with dotPeek, or an XLA file you can open in Excel via Developer > Visual Basic. I tried both approaches with no luck.
回答1:
Do you know if this Excel Add-In was built using Excel-DNA? If it was, then you can extract the .NET assemblies from the .XLL file using ExcelDnaUnpack.
Source code is on GitHub: https://github.com/caioproiete/ExcelDnaUnpack
ExcelDnaUnpack is a command-line utility to extract the contents of ExcelDna add-ins packed with ExcelDnaPack
Usage: ExcelDnaUnpack.exe [<options>]
Where [<options>] is any of:
--xllFile=VALUE The XLL file to be unpacked; e.g. MyAddIn-packed.xll
--outFolder=VALUE [Optional] The folder into which the extracted files will be written; defaults to '.\unpacked'
--overwrite [Optional] Allow existing files of the same name to be overwritten
Example: ExcelDnaUnpack.exe --xllFile=MyAddins\FirstAddin-packed.xll
The extracted files will be saved to MyAddins\unpacked
回答2:
As a general answer, XLL are written using the Excel C Api, they are in reality standards dlls. When you create a xll, you basically create a dll and rename the extension to turn it in a .xll. So your question in fact resume to this question : How to decompile c++ dll?
来源:https://stackoverflow.com/questions/31143490/possible-to-view-source-code-or-decompile-xll-excel-add-in