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.
  • Dan A

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

  • admin

    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!

  • http://trendytuts.com/ Web Design

    Thats not possible in E2007, unless you are happy for your add-ins UI to be dumped in the badd ladds corner. Of course I guess … An xll is just a dll with some registration info excel can use to call it directly from a cell. 

  • Follow me on Twitter Follow me on Twitter @voyce

  • Check out Wordz my new fast-paced make-a-word game for iOS.
  • Categories

  • Archives