processing XL using Win32::OLE
- From: aloknathlight@xxxxxxxxx (Alok Nath)
- Date: Thu, 28 Jun 2007 22:12:56 -0700 (PDT)
Hi,
Can anybody tell how to open an already existing xL file
and then probabaly do some processing using Win32::OLE
I found quite a few examples but none of them open an
existing excel file.
Or is there some better module for XL processing ?
Here is my code ..
use strict ;
use warnings ;
use Win32::OLE;
use Win32::OLE::Const;
my $file = "Matrix.xls" ;
my $ex ;
eval {$ex = Win32::OLE->GetActiveObject('Excel.Application')};
die "Excel not installed" if $@;
unless (defined $ex) {
$ex = Win32::OLE->new($file, sub {$_[0]->Quit;})
or die "Oops, cannot start Excel";
}
# get a new workbook
my $book = $ex->Workbooks->Add;
my $Sheet = $book->Worksheets(1);
$***->{Name} = 'Candle';
$book->Close;
Thanks
Alok.
____________________________________________________________________________________
Never miss an email again!
Yahoo! Toolbar alerts you the instant new Mail arrives.
http://tools.search.yahoo.com/toolbar/features/mail/
- Follow-Ups:
- Re: processing XL using Win32::OLE
- From: Prabu Ayyappan
- Re: processing XL using Win32::OLE
- Prev by Date: Adding a line in a file inside many directories
- Next by Date: Re: processing XL using Win32::OLE
- Previous by thread: Formats for invoices.
- Next by thread: Re: processing XL using Win32::OLE
- Index(es):