in reply to win32::OLE problem with perl2exe

No error message but the spreadsheet remains unchanged. Can anyone help?

You can help yourself if you show a minimal example which demonstrates your problem (you're probably not error checking)

Replies are listed 'Best First'.
Re^2: win32::OLE problem with perl2exe
by greyhawk (Novice) on Mar 14, 2010 at 12:17 UTC

    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;