Hi all,
The following code works with an existing .xls file, but I can't seem to
create a new one. I've tried prefixing the filename >testfile.xls and using
New(Excel.Workbook) - all to no avail.
Any ideas? TIA
use Win32::OLE;
$ex = Win32::OLE->GetActiveObject('Excel.Application');
if (!$ex) {
$ex = Win32::OLE->new('Excel.Application', sub {$_[0]->Quit;})
or die "Cannot create excel session - $!";
}
$book = $ex->Workbooks->Open('test.xls');
$book->Worksheets(1)->Cells(1,1)->{Value} = 'Hello';
$book->Worksheets(1)->Cells(1,2)->{Value} = 'World';
$book->save;
Ed Ewen
(404) 575-3531
[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
---
You are currently subscribed to perl-win32-users as: [[email protected]]
To unsubscribe, forward this message to
[EMAIL PROTECTED]
For non-automated Mailing List support, send email to
[EMAIL PROTECTED]