开发者

How to catch errors and debug Excel DLL Add-Ins created under Visual Studio 2010 in C++?

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.

  1. What's the best way to catch execptions/errors inside your C++ code?
  2. How can you debug your DLL functions called from Excel worksh开发者_如何学运维eets or VBA?


  1. 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.

  2. To debug your dlls you can have VS attach to the excel process you will be able to debug.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜