in reply to Win32::OLE: how to call Excel VBA macros and catch all VBA errors without dialog boxes appearing?

A correction to my original question, where I said:

There may be a connection with a related problem as described in the Xtreme Visual Basic Talk forum at How to Catch An Excel Runtime Error From a WinForm? . Here, a reply by Microsoft MVP Mike Rosenblum says that the VBA code is run in a separate thread, and that therefore, error trapping will not work because the caller (Perl, for me) cannot trap the error thrown on the callee (the VBA macro)'s thread.

But in later posting #9, Mike said:

I'm now pretty sure that I was wrong about that. The call seems to be on the same thread, and the caller simply hangs, waiting for the user to reply to the error message box presented by VBA. Once handled by the user, execution continues. But since the error was handled at the VBA-level, no exception is propagated to the caller.

  • Comment on Re: Win32::OLE: how to call Excel VBA macros and catch all VBA errors without dialog boxes appearing?