in reply to Capturing excel macro errors

jrsimmon:

Perhaps you should make your macros execute not when they're opened but on some user action so you can be sure that there will be someone there to fix/report the problem?

...roboticus

Replies are listed 'Best First'.
Re^2: Capturing excel macro errors
by jrsimmon (Hermit) on Dec 01, 2007 at 14:00 UTC
    The purpose of the reporter script is to automate a group of reports that my team uses daily to monitor the status of all the machines we support. We're trying to get away from any user intervention at all.

    I am gradually building in ways to detect that a report is hung (the typical end result of a macro error), but it would be so much better if I could just get the error passed back to OLE instead of having to figure out that it has occurred by polling the appl, checking runtime, etc...
      Perhaps you might have success with Spreadsheet::WriteExcel? I've had very good luck with that. (Originally had to use it because we can't install Office on our servers.)

      It might not be able to do everything you can do via OLE automation, but it doesn't tend to have error messages with dialog boxes, either.

      ...roboticus

        I appreciate the suggestion, but I'm afraid it pulls me away from the goal I'm trying to achieve (which I should have stated more clearly).

        The application only exists to take an excel spreadsheet generated by a user (who need not know anything about perl), refresh the data (which perl need not know anything about), and distribute the resulting report. It actually prints it to a postscript file, converts that to a pdf, and distributes the pdf in most cases. I didn't include this in the original post because I was afraid it would be a distraction to my main question.

        Given the silence of the monks, I'm guessing that excel doesn't provide a method of returning errors back through OLE to the calling program.

        Again, i appreciate your suggestions. Unfortunately they're just not quite what I'm looking for.