in reply to Problem opening Excel file using Win32::OLE

Below is the error i get from running the script. This excel file i would like to open it invisible so that i can run it on the background.
Win32::OLE(0.1603) error 0x8001010a: "The message filter indicated tha +t the application is busy" in METHOD/PROPERTYGET "" at C:\graph\test1.pl line 18

Replies are listed 'Best First'.
Re^2: Problem opening Excel file using Win32::OLE
by Scott7477 (Chaplain) on Feb 09, 2006 at 07:53 UTC
    The following line of code appears to be superfluous:

    #my $Excel = Win32::OLE->new('Excel.Application', 'Quit'); # use the +Excel application if it's open, otherwise open new


    why not delete it...

    Also, try using the following code which I grabbed from the ActivePerl User Guide to check to see if Excel is already running(obviously replacing with your filename variables):

    # use existing instance if Excel is already running eval {$ex = Win32::OLE->GetActiveObject('Excel.Application')}; die "Excel not installed" if $@; unless (defined $ex) { $ex = Win32::OLE->new('Excel.Application', sub {$_[0]->Qui +t;}) or die "Oops, cannot start Excel"; }


    Scott