Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^3: Win32::OLE called by subroutine only workes once

by fish (Novice)
on Aug 14, 2009 at 06:59 UTC ( #788543=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Win32::OLE called by subroutine only workes once
in thread Win32::OLE called by subroutine only workes once

Ok, obviously it was just fortune that it worked with close(1).

Today I want to use the script again and it fails saying: Win32::OLE(0.1709) error 0x80010108: "Das aufgerufene Objekt wurde von den Clients getrennt"

Does anybody has an idea how I can solve this problem?


Comment on Re^3: Win32::OLE called by subroutine only workes once
Re^4: Win32::OLE called by subroutine only workes once
by ganeshabelavadi (Novice) on May 13, 2011 at 11:16 UTC
    Hi, Even I'm facing same issue The error says "Win32::OLE(0.1709) error 0x80010108: "The object invoked has disconnected from its clients"" I'm calling the function twice which is having excel opening and closing commands. Please help how can I solve this issue?
      I'm writing a script which opens each excel file in a directory, reads some values from the workbook, then closes the workbook, and I had the same problem of Excel quitting when I closed the workbook.

      The inspiration came when I noticed the problem did not happen if I manually opened Excel first (with the default, blank "Book1")

      The work-around I used was to create a new workbook first, process all the files, (open, close, open, close...) then close my "KeepOpen" workbook when I was all done:

      $KeepOpen = $Excel->Workbooks -> Add; # your code / loop here $KeepOpen -> Close;

      Hope this helps,
      -- zaaj

      I've found Excel OLE to be quirky like this. My pseudo subclass suddenly stopped working due to this error, I found it was because the order of operations had changed. I made sure the following global operations happened before any book level or worksheet level op. happened.
      my $ex = Win32::OLE->GetActiveObject('Excel.Application') || Win32::OLE->new('Excel.Application', 'Quit'); if (not defined $ex) { die "couldn't get an instance of Excel"; } $ex->{DisplayAlerts}=0; $ex->{SheetsInNewWorkbook} = 1; $ex->{Visible} = 0 ; $Win32::OLE::Warn = 3; # Die on Errors.
Re^4: Win32::OLE called by subroutine only workes once
by Anonymous Monk on Jan 26, 2012 at 09:07 UTC
    Hello, did you solve this problem? I have the same problem at the moment. My script runs some weeks very fine. But since three days I have this problem. First I get this error only if I try to open the second excel file, now I get it at the first call, too. Thanks in advanced. Tim
Re^4: Win32::OLE called by subroutine only workes once
by Anonymous Monk on Jan 26, 2012 at 09:08 UTC

    Hello,

    did you solve this problem? I have the same problem at the moment. My script runs some weeks very fine. But since three days I have this problem. First I get this error only if I try to open the second excel file, now I get it at the first call, too.

    Thanks in advanced.
    Tim

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://788543]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2015-07-05 23:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (68 votes), past polls