Dumping Excel XLL add-in calls

Using WinDbg it’s possible to get a dump of each XLL call that is made by Excel as it calculates. If you’re using Excel 2003, create the following breakpoint that dumps the symbol at eax+4 (the entry point that is about to be called), then continues.:

bu EXCEL!MdCallBack+0xa880 "dds @eax+0x4 L1; g"

You’ll need to adjust the offset for other versions of Excel – and I haven’t tried it yet with 2007. Assuming you’ve got symbols available for the XLLs being called, you’ll get something like this:

0013bc50 15109730 addin1!addin1_function1
0013bc50 12c0e918 addin2!addin2_anotherfunctions

This technique can be useful when troubleshooting – to identify the last addin call being made before a failure perhaps – and is also quite interesting to just watch and see the pattern in which your XLL UDFs get called.

This entry was posted in Debugging, Excel, WinDbg. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

2 Comments

  1. Dan A
    Posted July 17, 2008 at 5:39 pm | Permalink

    But … surely you still have my Excel Profiler that does this without the debugger?!?

  2. admin
    Posted July 21, 2008 at 8:53 am | Permalink

    Maybe… The problem is when your Excel session crashes or hangs at some point during calculation. At that point having diagnostics running within the same process isn’t much use.

    Anyway, hope you’re well, Dan!

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">