Re: Spread***::ParseExcel
- From: "Mick" <karanarora.in@xxxxxxxxx>
- Date: 16 Nov 2006 21:12:22 -0800
Hey Mumia
Thanks a lot for your help!!
Regards
Karan
Mumia W. (reading news) wrote:
On 11/16/2006 05:55 AM, Karan Arora wrote:
Hi
I am not able to use the functions RowRange() and ColRange() available
with the package Spread***::ParseExcel::Work***. They return value
0 and -1 indicating that the work*** is empty (which is definitely
not the case) and not the correct values for the range. Has anyone
faced this problem before. Please help.
--------------------------------------------------------------------
use OLE;
use Win32::OLE qw(in with);
use Win32::OLE::Const 'Microsoft Excel';
use Spread***::WriteExcel;
use Spread***::ParseExcel;
$xlfile ="c:\\sample.xls";
if (-e "$xlfile")
{
##### OLE - Excel Connection
# Create OLE object - Excel Application Pointer
$xl_app = CreateObject OLE 'Excel.Application' || die $!;
print "Excel launched successfully \n";
# Set Application Visibility
$xl_app->{'Visible'} = 0;
# Open Excel File
$workbook = $xl_app->Workbooks->Open($xlfile);
print 'Opening ', $xlfile, "....\n";
# setup active work***
$worksheet = $workbook->Worksheets('Test History');
#Print the SheetName
my $sheetName = $worksheet->Name;
print $sheetName," is the sheet name\n";
#Find the size of the defined cells on the ***
my ($rowMin,$rowMax) =
$work***->Spread***::ParseExcel::Work***::RowRange();
my ($columnMin,$columnMax) =
$work***->Spread***::ParseExcel::Work***::ColRange();
print "Row Min = ", $rowMin, " Row Max = ", $rowMax, " Column Min = ",
$columnMin, " Column Min = ", $columnMax;
--------------------------------------------------------------------
Spread***::ParseExcel's RowRange() method only works on objects
created by Spread***::ParseExcel->new().
Since $work*** was created by Win32::OLE, $work*** is the wrong kind
of object on which to invoke RowRange().
Win32::OLE and Spread***::ParseExcel have nothing to do with one
another and have completely different ways if interacting with an Excel
file. If you use one in a script, it's unlikely you'll need the other.
I advise you to find the Win32::OLE (Excel ?) equivalent of RowRange().
--
paduille.4060.mumia.w@xxxxxxxxxxxxx
.
- References:
- Spread***::ParseExcel
- From: Karan Arora
- Re: Spread***::ParseExcel
- From: Mumia W. (reading news)
- Spread***::ParseExcel
- Prev by Date: Re: CPAN tool problems, Windows XP
- Next by Date: Re: CPAN tool problems, Windows XP
- Previous by thread: Re: Spread***::ParseExcel
- Next by thread: Re: Spread***::ParseExcel
- Index(es):