rpike has asked for the wisdom of the Perl Monks concerning the following question:

Hi All, I have a perl/cgi script that utilizes Win32::OLE to create Excel charts. Running the module locally and from DOS the Quit method for the Excel.Application object closed down the Excel.exes from Task Manager fine. Running locally and from the browser the Excel.exes hung around in the Task Manager. After using the Win32::OLE->Uninitialize method it closed them down fine. On a customer site the attempt to using GetActiveObject failed (passing Excel.Application as the argument). After finding out about setting permissions appropriately on the DCOM service it retrieved Excel fine. However, although the Excels start fine they do not close using the Quit method or the Uninitialize method. Is there something else I can try? Thanks for any help in advance. Rob

Replies are listed 'Best First'.
Re: Excel Win32::OLE->Uninitialize
by traveler (Parson) on Jan 13, 2006 at 16:00 UTC
    I have had similar problems. One thing is to be sure that the problematic installation is a recent versionof Office. OLE automation in some earlier versions was prone to problems like this.

    Another thing is to be sure to set the objects associtatd with Excel to undef. The object needs to be RELEASEed. That should be automatic, but I am not sure it always is. I do not know the perl form of the explicit RELEASE.

    HTH --traveler

      Traveller,

      I tried using the undef function on the objects in question... nothing. I was looking at the properties in DCOM and there are a few things in there to set according to user. Would any of these settings disallow the script (the user is running) to not be able to uninitialize but allow it to start up and run fine? Thanks for the info before. Oh, also, the customer machine and the machine I'm running the script on locally are pretty much similar (same OS, same version of perl, etc..,).

      Rob

        I have not had any experience with the properties you allude to. I did some reading and some folks have mumbled about not closing excel if program that started it does not exit or clean up well. Sorry, the writers were not too explicit. How are you running it at the client? From DOS? When you run it from the browser, how are you starting it? Is a web server involved?