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

Hi monks,
Now I have one more problem with excel. the error is
Win32::OLE(0.1701) error 0x8001010a: "The message filter indicated tha +t the application is busy" in METHOD/PROPERTYGET "" at C:\\export.pl +line 24
the script i am trying to execute is
use Win32::OLE qw(in with); use Win32::OLE::Const 'Microsoft Excel'; use Win32::OLE::Variant; use Win32::OLE::NLS qw(:LOCALE :DATE); use Win32::OLE; use Win32::OLE::Const; use strict; $Win32::OLE::Warn = 3; # die on errors... my $file = "C:\\testw.txt"; open (TTT, ">$file") || die "error"; my $filename = "C:\\book1.xls"; my $filter = 'gif'; # can be GIF, JPG, JPEG or PNG my $pngnm = "C:\\test"; eval{ my $Excel = Win32::OLE->new('Excel.Application', 'Quit'); # use the Ex +cel application if it's open, otherwise open new my $Book = $Excel->Workbooks->Open( $filename ); # open the file foreach my $Sheet (in $Book->Sheets) { # loop through all sheets foreach my $ChartObj (in $Sheet->ChartObjects) { # loop through all chartobjects in the sheet #$datewk = join("".split(/\s+/, $Date)); my $savename = "$pngnm" . ".$filter"; #$savename = "$dirpath\\$pngnm" . ".$filter"; # Write image to PNG file my $t = $ChartObj->Chart->Export({ FileName => $savename, FilterName => $filter, Interactive => 0 }); } } $Book->Close({SaveChanges=>0}); }; my $rrr = Win32::FormatMessage(Win32::GetLastError()); my $err = $@; print TTT $err;
The same script excutes without any error on the other server with same configuration. Windows 2003 server office 2000 standard It is creating the png file & then giving this error. I suspect it could be a security issue. If so please tell me what permissions it requires?
Thanks

Replies are listed 'Best First'.
Re: Win32::OLE(0.1701) error 0x8001010a
by GrandFather (Saint) on Sep 01, 2005 at 09:53 UTC

    The following is from an old version of the MSDN library, but may be what you need to know:

    SYMPTOMS
    When Automating Microsoft Word 2000 with Microsoft Visual Basic, you may receive the following error during a call to CreateObject or New:

    Run-time error '-2147417846 (8001010a)':
    Automation Error
    When automating Word 2000 with Microsoft Visual C++, you might receive the following error when calling IClassFactory::CreateInstance:
    Error (0x80010001): Call was rejected by callee. or CoCreateInstance:
    Error (0x8001010A): The message filter indicated that the application is busy.

    CAUSE
    This error occurs on a system where Norton AntiVirus 2000 has been installed.
    Microsoft Office 2000 supports AntiVirus plug-ins that can scan Office documents before they are opened. When the Norton AntiVirus plug-in is enabled on a system with Word 2000, you receive one of the messages above when trying to start Word through Automation.

    RESOLUTION
    To resolve the issue, remove the Norton AntiVirus plug-in for Microsoft Office 2000. To accomplish this, follow the steps below:

    From the Start menu, click Run. Type the following command (including quotes) on the Run line (change the path to the file as needed):

    regsvr32 /U "C:\Program Files\Norton AntiVirus\OfficeAV.dll"
    Note that you receive a dialog box stating that the command succeeded.


    Perl is Huffman encoded by design.
      I stoped antivirus services temporarily & tried to execute the script. then also i got the same error.
Re: Win32::OLE(0.1701) error 0x8001010a
by fizbin (Chaplain) on Sep 01, 2005 at 13:36 UTC
    This kb article also says that a corrupt Normal.dot file can cause the same error. The article recommends that you rename the Normal.dot file to something else, try your application again, and if it now works try to fix the corruption in Normal.dot by recreating it and copying over any styles and macros you wanted saved from the corrupted version.

    Of course, if that isn't your problem, don't forget to rename Normal.dot back to its proper name.

    See the article for a detailed procedure - basically, you need to make sure that everything that uses Word is shut down before doing the rename, and you need to get all the Normal.dot files on your hard drive.

    --
    @/=map{[/./g]}qw/.h_nJ Xapou cets krht ele_ r_ra/; map{y/X_/\n /;print}map{pop@$_}@/for@/