Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: OLE - Getting all rows from Excel

by t0mas (Priest)
on May 10, 2000 at 12:00 UTC ( #10915=note: print w/ replies, xml ) Need Help??


in reply to OLE - Getting all rows from Excel

The following code works fine for me ...

use Win32::OLE; $excel = Win32::OLE->new("Excel.Application"); $excel->{Visible} = 1; $workbook = $excel->Workbooks->Open("test.xls"); $sheet = $workbook->Worksheets(1); $everything=$sheet->UsedRange()->{Value}; for (@$everything) { for (@$_) { print defined($_) ? "$_|" : "<undef>|"; } print "\n"; } $excel->Quit;
/t0mas


Comment on Re: OLE - Getting all rows from Excel
Download Code
Replies are listed 'Best First'.
RE: Re: OLE - Getting all rows from Excel
by httptech (Chaplain) on May 10, 2000 at 15:28 UTC
    That's terrific... Where did you find that? I can't seem to find any good Excel OLE references for Perl beyond the simple "create a worksheet and insert X rows" examples. What do you use as your reference material?
      I actually only use Objectviewer in the Visual Basic Editor...
      There is a good overview of the Excel Object model in the online help.
      Sorry to dissapoint you.

      /t0mas
        No disappointment, I see it now. Just hard to shift from "perldoc" to helpfiles. I was hoping there was some documentation on the web somewhere of a brave Perl programmer venturing into the world of OLE. Maybe I'll have to write that. ;)

        This should be what I need to finish my application. Thanks!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (9)
As of 2015-07-30 09:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (270 votes), past polls