in reply to Re: Win32::OLE Excel LastCol not working consistently
in thread Win32::OLE Excel LastCol not working consistently

Thank you. I tried your code it did give some values but not right. The Column was right but row was not. I had last row at 109 but it gave me 1972.

I also saw links you sent but doesnt answer the last row/col question. I thought there should be a function GetLastRow or GetLastCol - may be not!

  • Comment on Re^2: Win32::OLE Excel LastCol not working consistently

Replies are listed 'Best First'.
Re^3: Win32::OLE Excel LastCol not working consistently
by uvs (Novice) on Oct 25, 2007 at 20:34 UTC
    Ok it works now!!
    This one particular worksheet had a formula that was not right and it was in column B so it only gave last column=1. After correcting the problem, the old code worked as expected.
    my $LastRow = $sheet->UsedRange->Find({What=>"*",SearchDirection=>xlPr +evious,SearchOrder=>xlByRows})->{Row}; my $LastCol = $sheet->UsedRange->Find({What=>"*",SearchDirection=>xlP +revious,SearchOrder=>xlByColumns})->{Column};