in reply to Re^3: Capturing excel macro errors
in thread Capturing excel macro errors

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.

Replies are listed 'Best First'.
Re^5: Capturing excel macro errors
by roboticus (Chancellor) on Dec 03, 2007 at 02:14 UTC
    jrsimmon:

    Okay, then. Three final useless suggestions before I go to bed. ;^)

    1) How about have a (generous) timeout on the operation and assume it failed if you reach it? (Course, then you'd have to kill the job, and "graceful shutdown" is no longer on the menu.)

    2) Assuming the problem is a dialog box hanging you up, maybe a perl program that would "notice" new windows on the server and nudge your script if it happens to belong to Excel?

    3) Go all out and hook into the debugger hooks (the ones that ask you if you want to debug the application yadda yadda), make a perl module that handles it, post it on CPAN, and reap the glory? ;^D

    (I was originally going to give you a different three suggestions. The third one was "Profit", but I couldn't figure out the second one.....)

    ...roboticus

      I'm working on #1 currently. I like #2...that helps...now I only have to figure out how to do it...I'll get back to you on #3 when I have a bit more perl experience! Thanks for your help.