Possible to view source code or decompile XLL Excel add in

Hoppe picture Hoppe · Jun 30, 2015 · Viewed 9k times · Source

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.

Answer

C. Augusto Proiete picture C. Augusto Proiete · Nov 30, 2015

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/augustoproiete/ExcelDnaUnpack

You can download ExcelDnaUnpack.exe (the compiled tool ready to use) in the Releases tab of the project on GitHub.


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