package StatementExcel; require Exporter; @ISA = qw(Exporter); @EXPORT = qw(LoadExcel ProcessPreparedSheet); use strict; use warnings; use Encode; use 5.014; use utf8; use Win32::Console; use autodie; use warnings qw< FATAL utf8 >; use Carp; use Win32::OLE qw(CP_UTF8); use Win32::OLE::Const 'Microsoft Excel'; use Cwd; use Text::CSV::Unicode; use File::BOM qw( :all ); use List::MoreUtils 'first_index'; sub LoadExcel { Win32::OLE->Option(CP => CP_UTF8); # set utf8 encoding binmode(STDOUT, ':unix:utf8'); binmode $DB::OUT, ':unix:utf8' if $DB::OUT; # for the debugger Win32::Console::OutputCP(65001); # Set the console code page to UTF8 my ($i,$j,$StatementRef); my ($xlApp, $xlBook, $Sheet, $rng, $tbl, $xlFile, $RowRecStart, # line where statement records will start $ColRecStart, # column where statement records will start $StatementRows, # number of statement rows $HeadingRange, $RecordsRange); my (@Statement, @Heading); my @columns = ('a'..'z'); $Win32::OLE::Warn = 2; my %parms = @_; # ... more code $xlApp = Win32::OLE->new('Excel.Application'); # Start Excel and make it visible # ... more code #### Win32::OLE(0.1709) error 0x80020009: "Exception occurred" in METHOD/PROPERTYGET "ActiveChart" at D:/MyPrograms/System/StrawberryPerl/perl/vendor/lib/Win32/OLE/Lite.pm line 216. ... called at D:/My Documents/Technical/Perl/Eclipse workspace/.metadata/.plugins/org.epic.debug/perl5db.pl line 646 DB::eval called at D:/My Documents/Technical/Perl/Eclipse workspace/.metadata/.plugins/org.epic.debug/perl5db.pl line 3244 DB::DB called at D:/My Documents/Technical/Perl/Eclipse workspace/StatementExcel.pm line 87 StatementExcel::LoadExcel('StatementRef', 'ARRAY(0x1c72e0c)', 'FilesRef', 'HASH(0x1c7d80c)', 'Debug', 1, 'XLFileName', 'D:\My Documents\Technical\Perl\Eclipse workspace\FIBI\Work\FI...', 'OutpStructRef', ...) called at D:/MyPrograms/System/StrawberryPerl/perl/vendor/lib/Win32/OLE/Lite.pm line 216. ... Win32::OLE(0.1709) error 0x80020009: "Exception occurred" in METHOD/PROPERTYGET "Charts" at D:/MyPrograms/System/StrawberryPerl/perl/vendor/lib/Win32/OLE/Lite.pm line 216. ... DB::eval called at D:/My Documents/Technical/Perl/Eclipse workspace/.metadata/.plugins/org.epic.debug/perl5db.pl line 3244 DB::DB called at D:/My Documents/Technical/Perl/Eclipse workspace/FIBI/StatementExcel.pm line 87 StatementExcel::LoadExcel('StatementRef', 'ARRAY(0x1c72e0c)', 'FilesRef', 'HASH(0x1c7d80c)', 'Debug', 1, 'XLFileName', 'D:\My Documents\Technical\Perl\Eclipse workspace\FIBI\Work\FI...', 'OutpStructRef', ...) called at D:/My Documents/Technical/Perl/Eclipse workspace/FIBI/FIBI Conv.pl line 121 ... Win32::OLE(0.1709) error 0x80020009: "Exception occurred" in METHOD/PROPERTYGET "Excel4IntlMacroSheets" at D:/MyPrograms/System/StrawberryPerl/perl/vendor/lib/Win32/OLE/Lite.pm line 216. ... Win32::OLE(0.1709) error 0x80020009: "Exception occurred" in METHOD/PROPERTYGET "Excel4MacroSheets" at D:/MyPrograms/System/StrawberryPerl/perl/vendor/lib/Win32/OLE/Lite.pm line 216. eval {...} called at D:/MyPrograms/System/StrawberryPerl/perl/vendor/lib/Win32/OLE/Lite.pm line 216 Win32::OLE::Tie::FETCH('Win32::OLE::Tie=HASH(0x25ee6ec)', 'Excel4MacroSheets') called at D:/My Documents/Technical/Perl/Eclipse workspace/.metadata/.plugins/org.epic.debug/dumpvar_epic.pm line 162 ... Win32::OLE(0.1709) error 0x80020009: "Exception occurred" in METHOD/PROPERTYGET "FileFind" at D:/MyPrograms/System/StrawberryPerl/perl/vendor/lib/Win32/OLE/Lite.pm line 216. ...