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

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};