#!/usr/bin/perl -w use strict; use Cwd; use Win32::OLE; use Win32::OLE::Const 'Microsoft Excel'; my $application = Win32::OLE->new("Excel.Application"); my $workbook = $application->Workbooks->Add; my $worksheet = $workbook->Worksheets(1); $worksheet->Cells(1,1)->{Value} = "Hello World"; # Get current directory using Cwd.pm my $dir = cwd(); # Turn off some Excel warnings $application->{DisplayAlerts} = "False"; $workbook->SaveAs($dir . '/win32ole.xls'); # Turn them back on (just in case) $application->{DisplayAlerts} = "True"; $workbook->Close;
--
John.
In reply to Re: OLE Save and SaveAs
by jmcnamara
in thread OLE Save and SaveAs
by blackadder
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |