How to debug the unmanaged C++ XLL code

291 views
Skip to first unread message

anonym...@gmail.com

unread,
Nov 14, 2015, 7:34:52 AM11/14/15
to Excel-DNA
Hi,

I am looking to tweak the C++ XLL code slightly and wanted to know how I can setup debugging for this?

Thanks

Govert van Drimmelen

unread,
Nov 14, 2015, 10:35:09 AM11/14/15
to Excel-DNA
Hi,

Try this:

* Put a file called ExcelDna.dna in the Source\ExcelDna\Debug\ folder. It might have some code in (like Distribution\ExcelDna.dna) or point to your own <ExternalLibrary...>

* If I want to be careful, I always do Build -> Batch Build and select everything (or all the Debug projects) and then rebuild.

* Set the ExcelDna project as the Startup project, and under the project properties, Configuration Properties, Debugging, set the Command as $(TargetPath). You can set the Working Directory as $(ProjectDir). Then press F5 and you should be debugging.

* Alternatively, start Excel outside the debugger, then Debug -> Attach to Process, pick Excel.exe and be sure to include 'native' in the Debugger types.

Please write back if you're still stuck, or find anything we can add to these instructions.

Regards,
Govert
Message has been deleted
Message has been deleted

anonym...@gmail.com

unread,
Nov 14, 2015, 6:48:10 PM11/14/15
to Excel-DNA
Hi Govert,

I still cannot set it up. If I try the first method I get the error: Unable to start program '<path to xll>' Operation not supported. Unknown error: 0x800700c1.

If I try to attach to the Excel.exe process then the breakpoints I set are not hit. Visual studio says that no symbols have been loaded for this document.

Govert van Drimmelen

unread,
Nov 15, 2015, 7:38:46 AM11/15/15
to Excel-DNA
If you double-click in Explorer on an .xll file, does it open Excel?
If not, the file association is not set up. Normally it is set when Excel is installed.

I guess as an alternative for the Debugging Command you can put the whole path to Excel.exe, and pass in the .xll as the first command-line parameter.

When attaching to Excel, you have to then File->Open the Debug\ExcelDna.xll to load the add-in.

-Govert

anonym...@gmail.com

unread,
Nov 15, 2015, 4:27:56 PM11/15/15
to Excel-DNA
Thanks Govert, it now works!
Reply all
Reply to author
Forward
0 new messages