I use Visual Studio 2010 to make DLL add-ins for Excel 2010 that I include via VBA. I heard that errors in the add-in can crash Excel, for example accessing an array out-of-range.
- What's the best way to catch execptions/errors inside your C++ code?
- How can you debug your DLL functions called from Excel worksh开发者_如何学运维eets or VBA?
You can use c++ exceptions to catch errors and if you wrap all of your entry points of your dlls in try catches you can keep your errors from bubbling to the higher level.
To debug your dlls you can have VS attach to the excel process you will be able to debug.
精彩评论