Win32::OLE question(s)
- From: timlhunt@xxxxxxxxxxxxxx (Tim)
- Date: Tue, 30 Aug 2005 17:12:52 -0400
Hello.
The following code produces the output below. The first column should be a date. This happens whether the "valof" function is used or not. Anyone have any Variant tricks?
Thanks. Tim
my $Excel = Win32::OLE->GetActiveObject('Excel.Application')
|| Win32::OLE->new('Excel.Application', 'Quit'); # get already active Excel
# application or open new
my $Book = $Excel->Workbooks->Open("C:\\orders.xls"); # open Excel file
my $Sheet = $Book->Worksheets(2); # select work*** number 1
print "***: ", $***->Name, "\n";
my $array = $***->Range("G4:H12")->{'Value'}; # get the contents$Book->Close;
foreach my $ref_array (@$array) { # loop through the array
foreach my $scalar (@$ref_array) {
print valof($scalar),"\t";
}
print "\n";
}***: Inventory Order By Qty Win32::OLE::Variant=SCALAR(0x1a0d108) 400 Win32::OLE::Variant=SCALAR(0x1a10310) 84 Win32::OLE::Variant=SCALAR(0x1a102f8) 100 Win32::OLE::Variant=SCALAR(0x1a102e0) 196 Win32::OLE::Variant=SCALAR(0x1a0d108) 100 Win32::OLE::Variant=SCALAR(0x1a10310) 1 Win32::OLE::Variant=SCALAR(0x1a102f8) 100 Win32::OLE::Variant=SCALAR(0x1a102e0) 200
.
- Prev by Date: Re: Escaping with tr
- Next by Date: Re: Escaping with tr
- Previous by thread: Escaping with tr
- Next by thread: RE: Win32::OLE question(s)
- Index(es):