Reputation: 61
#___ FIND LAST ROW/COLUMN WITH DATA
my $row = $Sheet1 -> UsedRange -> Find(
{ What => "*",
SearchDirection => xlPrevious,
SearchOrder => xlByRows
})-> {Row};
Error:
Bareword "xlByRows" not allowed while "strict subs" in use.
Upvotes: 3
Views: 901
Reputation: 141
You have to put use Win32::OLE::Const 'Microsoft Excel';
at the top of your program to import the constants correctly.
Take a look at this Perl Monks page. It seems to cover the issues you are having.
Upvotes: 4
Reputation: 331
See CPAN docs for Win32::OLE::Const
You need to:
use Win32::OLE::Const 'Microsoft Excel';
Upvotes: 4
Reputation: 5174
xlByRows is not a constant, you should put it in quotes. Unless it's a constant exported by the OLE object, in which case you need to import it into your namespace using Win32::OLE::Const or similar.
Upvotes: 1