Title: RE: Excel

Thank you

-----Original Message-----
From: Charbeneau, Chuck [mailto:[EMAIL PROTECTED]]
Sent: 27 January 2003 05:19
To: 'Mundell, R. (Ronald)'; Perl-Unix-Users (E-mail); Perl-Win32-Users
(E-mail)
Subject: RE: Excel




From: Mundell, R. (Ronald) [mailto:[EMAIL PROTECTED]]
Subject: Excel


> How do one determine the amount of lines within a spreadsheet


From: http://perlmonks.org/index.pl?node_id=153486

<CODE>
use strict;

use Win32::OLE qw(in with);
use Win32::OLE::Const 'Microsoft Excel';

$Win32::OLE::Warn = 3; # Die on Errors.

my $Excel = Win32::OLE->GetActiveObject('Excel.Application')
        || Win32::OLE->new('Excel.Application', 'Quit');

my $Book = $Excel->Workbooks->Open($excelfile); 
my $Sheet = $Book->Worksheets("Sheet1");
   $Sheet->Activate();
     
my $last_cell =
$Sheet->Range("A1")->EntireColumn->SpecialCells(xlCellTypeLastCell)->{Addres
s};
my ($last_col, $last_row) = $last_cell =~ /\$(\w+)\$(\d+)/;

</CODE>

C-.

**********************
** LEGAL DISCLAIMER **
**********************

This E-mail message and any attachments may contain
legally privileged, confidential or proprietary
information. If you are not the intended recipient(s),
or the employee or agent responsible for delivery of
this message to the intended recipient(s), you are
hereby notified that any dissemination, distribution
or copying of this E-mail message is strictly
prohibited. If you have received this message in
error, please immediately notify the sender and
delete this E-mail message from your computer.

Reply via email to