in reply to Excel exe still hanging 'round

I had a problem with this once, though it was in a comand line env. I know you specifically mention your current solution works fine on the comand line, but try it anyway... it can't hurt. What I had to do was call:

Win32::OLE->Uninitialize

at the very end. Depending on how your CGI is set up, it may be easiest for you to do this:

END { Win32::OLE->Uninitialize }

Good luck!

Ted Young

($$<<$$=>$$<=>$$<=$$>>$$) always returns 1. :-)

Replies are listed 'Best First'.
Re^2: Excel exe still hanging 'round
by Anonymous Monk on Jan 09, 2006 at 21:15 UTC
    Thanks Ted. Seems like it done the trick. Quick question though: By calling the Win32::OLE->Uninitialize does that or will it affect other simultaneous Excel processes running by other users on that machine? I'll see what I can find but what does the Uninitialize do (i.e. deletions, clears, etc..,)? Thanks so much for the reply. I had noticed some methods listed (including this one) but it wasn't near the top of methods I was going to try so thanks for saving me the trouble.

    Rob

      I strongly suspect it is mearly a call to the function CoUninitialize(); which uninits COM for the current thread. So, it should not effect other CGI processes.

      Ted Young

      ($$<<$$=>$$<=>$$<=$$>>$$) always returns 1. :-)
        Do you happen to know a good doc on-line that lists out some of the methods available (including CoUninitialize)? Thanks for the info as well. Rob
        Hi again Ted, Just a quick question hopefully. We have a web site set up whereby remote users log-in (I guess Windows Authenticated or whatever). One user logs in as administrator while the second as a plain user. The administrator can use the perl/cgi script fine. The other user cannot and gets an "Access is Denied" when she hits the code trying to initialize Excel (using GetActiveObject method). We've checked the permissions on the Excel.exe and set the permissions accordingly on the whole Microsoft Office directory but still it gives this error. Should the permissions be checked solely on the Registry key for Excel.Application or are there more things needed to be checked for permissions? Many thanks. Rob