Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
In order for me to obtain the used range, I need to obtain the last used column and row in that xls sheet. However, The last Column's value is returned as an Interger! But this codesub Get_Last_Row { my ($Sheet) = @_; $Sheet->UsedRange->Find({What=>"*", SearchDirection=>xlPreviou +s, SearchOrder=>xlByRows})->{ +Row} } sub Get_Last_Col { my ($Sheet) = @_; $Sheet->UsedRange->Find({What=>"*", SearchDirection=>xlPreviou +s, SearchOrder=>xlByColumns}) +->{Column} }
requires the last column value to be in the format of Letter.Number!#my $LastRange = $LastCol.$LastRow; $LastRange = 'IV'.$LastRow; $ArrayData = $DataSheet-> Range("A1:$LastRange")->{Value};
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Win32::OLE Excel Last Column problem,
by VSarkiss (Monsignor) on Oct 21, 2005 at 15:02 UTC | |
|
Re: Win32::OLE Excel Last Column problem,
by InfiniteSilence (Curate) on Oct 21, 2005 at 15:00 UTC | |
by VSarkiss (Monsignor) on Oct 21, 2005 at 15:08 UTC | |
by blackadder (Hermit) on Oct 21, 2005 at 15:15 UTC |