in reply to Re^3: Modifying an existing Excel file
in thread Modifying an existing Excel file
It works just as well without the "undef" commands.use strict; use Win32::OLE; #$doc = 'Smoke_Test.xls'; #$ex = Win32::OLE->GetObject($doc); my $ex = Win32::OLE->new('Excel.Application'); $ex->{Visible} = 1; $ex->{SheetsInNewWorkbook} = 1; # get a new workbook #$book = $ex->Workbooks->Add; my $book = $ex->Workbooks->Add; # write to a particular cell #$sheet = $book->Worksheets("Sheet1"); my $sheet = $book->Worksheets("Sheet1"); $sheet->Cells(1,1)->{Value} = "foo"; undef $book; undef $ex; exit(0);
|
|---|