RE: Win32::OLE question(s)
- From: Luke.Bakken@xxxxxxxxxxxxx (Luke Bakken)
- Date: Wed, 31 Aug 2005 10:54:53 -0400
Bakken, Luke wrote:
> Tim wrote:
>> 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
>
> Read up on the Range property and Cells property.
>
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbaxl11
> /html/xlproCells1_HV03076630.asp
>
> use strict;
> use Win32::OLE qw/in with/;
>
> my $Excel = Win32::OLE->GetActiveObject('Excel.Application') ||
> Win32::OLE->new('Excel.Application', 'Quit');
> my $Book = $Excel->Workbooks->Open("C:\\orders.xls");
> my $Sheet = $Book->Worksheets(2);
>
> for my $cell (in $***->Range("G4:H12"))
> {
> print "Cell has value ", $cell->Value, "\n";
> }
> $Book->Close;
That should be:
for my $cell (in $***->Range("G4:H12")->Cells)
.
- Prev by Date: Re: DBD::Oracle installation script assumes oracle is installed local ly?
- Previous by thread: RE: Win32::OLE question(s)
- Next by thread: how to replace multiple whit space with ", ".
- Index(es):