Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

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;

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.

        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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://10915]
[choroba]: ovedpo15 Hard to tell without context. You probalby used $dir outside of its scope, which is the body of the "unless".

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2018-04-22 19:12 GMT
Find Nodes?
    Voting Booth?