Thanks for that, BrowserUK. Unfortunately, when I tried SetErrorMode, it didn't help. Mike Rosenblum discussed this in general, in his extremely helpful postings #8 and #11 in the How to Catch An Excel Runtime Error From a WinForm? thread at Xtreme VB Talk. In #8, he says:
As you know, the problem is that VBA does not propagate any exception to the caller when a macro is called by the Excel.Application.Run method. Instead, Excel handles the error locally and displays an error message box to the user.
The only way around this is to not call the Excel.Application.Run method, period. No amount of attempting to tweak the API SetErrorMode() or the like will change anything, because, as far as the external caller is concerned, there is no error. There is no error because VBA handled it by displaying the error message box to the user. As far as I can see, there is no way around this.
So it looks as though this is something it's just not possible to do, via Perl or any other language. The best solution we have is suggested by Mike in #11. That's to call the macros from macros in a workbook object in another instance of Excel (these second macros are methods of the workbook object), and to call those macros from Perl. I show how I made it work in Java, in posting #12.