I can't seem to find any real documentation on getting the Excel parsing
stuff to work like I expect.
Here is my script--copied and modified from an example. I've looked
throught the win32::ole module and can't find any serious
documentation on things like --
my $date = $Sheet->Cells($row,$col)->{'Value'};
-- what other options do I have besides Value for example. For this
particular instance, the value comes back in a non-date format
which doesn't help me much.
Any help appreciated -- especially documentation. I don't mind figuring
this out myself, but I can't tell where to go to find the info I need.
--------------------------------------------------------
use strict;
use Win32::OLE qw(in with);
use Win32::OLE::Const 'Microsoft Excel';
$Win32::OLE::Warn = 3; # die on errors...
# get already active Excel application or open new
my $Excel = Win32::OLE->GetActiveObject('Excel.Application')
|| Win32::OLE->new('Excel.Application', 'Quit');
# open Excel file
my $Book = $Excel->Workbooks->Open("C:\\DW_Enhancement_Master.xls");
# You can dynamically obtain the number of worksheets, rows, and columns
# through the Excel OLE interface. Excel's Visual Basic Editor has more
# information on the Excel OLE interface. Here we just use the first
# worksheet, rows 1 through 4 and columns 1 through 3.
# select worksheet number 1 (you can also select a worksheet by name)
my $Sheet = $Book->Worksheets(1);
foreach my $row (1..104)
{
foreach my $col (1..9)
{
# skip empty cells
next unless defined $Sheet->Cells($row,$col)->{'Value'};
# print out the contents of a cell
if ($col == 1) {
my $date = $Sheet->Cells($row,$col)->{'Value'};
print "Project Date is ". $date."\n";
}
}
}
# clean up after ourselves
$Book->Close;
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]