Why does Perl complain about simple words in my Win32 :: OLE script?

#___ FIND LAST ROW/COLUMN WITH DATA
my $row = $Sheet1 -> UsedRange -> Find(
     {      What => "*", 
            SearchDirection => xlPrevious,  
            SearchOrder => xlByRows
      })-> {Row};

Mistake:

Bareword "xlByRows" not allowed while "strict subs" in use. 
+3
source share
3 answers

You must put it use Win32::OLE::Const 'Microsoft Excel';at the top of your program to correctly import constants.

Take a look at this Perl Monks page . It seems to cover the problems that you have.

+4
source

See CPAN Docs for Win32 :: OLE :: Const

You need:

use Win32::OLE::Const 'Microsoft Excel';
+4
source

xlByRows , . OLE, Win32:: OLE:: Const .

+1

Source: https://habr.com/ru/post/1704199/


All Articles