$excel = new-object -comobject Excel.Application $excel.visible = $true $workbook = $excel.workbooks.add() #### #!/usr/bin/perl -w use strict; use Win32::OLE; my $ex = Win32::OLE->new('Excel.Application', \&Quit); $ex->{visible} = 1; print "S1 .. "; sleep 10; print "Done.\n"; my $book = $ex->Workbooks->Add(); print "S2 .. "; sleep 10; print "Done.\n"; exit; #### S1 .. Done. OLE exception from "Microsoft Excel": Microsoft Excel cannot open or save any more documents because there is not enough available memory or disk space. ¢Æ To make more memory available, close workbooks or programs you no longer need. ¢Æ To free disk space, delete files you no longer need from the disk you are saving to. Win32::OLE(0.1709) error 0x800a03ec in METHOD/PROPERTYGET "Add" at try.pl line 11 S2 .. Done. #### OLE.xs:5764:39: warning: deprecated conversion from string constant to ¡®char*¡¯ [-Wwrite-strings]