Need your help once again. Initially i had a problem of consistently getting right value for last column and last row in excel file using Win32::OLE. I figured out following two cluprits.
1) If sort filters are turned on for column/s OR1) If the FILTER in excel is left on. i.e Lets say there is column sort filter and if some columns are filtered then it does not give right last column using the formula presented in Excel Tips and Tricks.
Interesting thing is, it does not stop at the filtered column but it gives some random last column value and same for last row. As soon as you fix (remove/undo the sort filter) it gives right answer. </>
2) If there is any unresolved formula for the column (#REF) it gives the same error (Well, it returns a value but it is not the right value so you cannot find out unless you validate your final parsing) of not finding the right last column in excel. After resolving, it works fine.
Thank you in advance.This is the code to determine Last Row and LastCol if everything is cl +ean and simple in excel file my $sheet =$oBook->Worksheets($iSheet); my $name =$oBook->Worksheets($iSheet)->{Name}; my $LastRow = $sheet->UsedRange->Find({What=>"*",SearchDirection=>xlPr +evious,SearchOrder=>xlByRows})->{Row}; my $LastCol = $sheet->UsedRange->Find({What=>"*",SearchDirection=>xlPr +evious,SearchOrder=>xlByColumns})->{Column};
In reply to How to CLEAR Sort filters in Excel by uvs
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |