Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: LastCol of an Excel spreadsheet as an alphanumeric using Win32::Ole

by traveler (Parson)
on Nov 23, 2005 at 00:38 UTC ( [id://510972]=note: print w/replies, xml ) Need Help??


in reply to LastCol of an Excel spreadsheet as an alphanumeric using Win32::Ole

I could not get your code to give me the last column, but this should work
use Win32::OLE; $Win32::OLE::Warn = 3; # die ( UGLY ) on errors... use Win32::OLE::Const 'Microsoft Excel'; my $Excel = Win32::OLE->new('Excel.Application', 'Quit'); my $Book = $Excel->Workbooks->Open("C:\\temp\\foo.xls"); my $Sheet = $Book->Worksheets(1); # select worksheet number 1 $date = $Sheet->UsedRange->End(xlToRight)->Cells(1,1)->{'Value'}; print "$date\n";
at least, that is how I have accessed data in an Excel sheet before.

HTH, --traveler

  • Comment on Re: LastCol of an Excel spreadsheet as an alphanumeric using Win32::Ole
  • Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://510972]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2024-04-19 22:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found