in reply to Re: win32::OLE problem with perl2exe
in thread win32::OLE problem with perl2exe
OK. Here is an example. It creates an Excel spreadsheet called test.xls containing a single cell containing "success"
It works fine (Windows XP Prof, Active State 5.10.1.1006) But if I produce example.exe using
perl2exe -o=example.exe example.pl
it doesn't produce test.xls
use Win32::OLE qw(in with); use Win32::OLE::Const 'Microsoft Excel'; use Cwd 'abs_path'; use File::Glob; $root = abs_path($0); $root =~ s/[^\\]*$//; $Win32::OLE::Warn = 3; my $Excel = Win32::OLE->new('Excel.Application', 'Quit'); $Excel->{DisplayAlerts}=0; my $Bookout = $Excel->Workbooks->Add(); $Bookout->SaveAs("${root}test.xls"); my $Sheetout = $Bookout->Worksheets(1); $Sheetout->Cells(1,1)->{'Value'}="Success"; $Bookout->Save; $Bookout->Close; $Excel->Quit; exit;
|
|---|