ok The writing is going fine now but the close still gets the error and the 0 byte file is still created. What I don't understand is that if the workbook object is destroyed prior to close, then I should get an error on the set_properties, correct?
Thanks
$csv = Text::CSV_XS-> new (\%csv) or die "Problem creating new CSV obj
+ect".Text::CSV_XS->error_diag ();
my $csv_file = @ARGV && -f $ARGV[0] ? $ARGV[0]: "csv2excel"; # ge
+t csv file name
+
+
my $wbk = Excel::Writer::XLSX->new (my $outfile = get_outfile($csv_fil
+e)) or die "Problems creating new Excel file: $!" unless defined $wbk
+;
+
$properties{'title'} ||= $opt_title;
+
+
+
read_row(open_csv());
$wbk->set_properties(%properties);
+
+
print Dumper($wbk->set_properties(%properties));
+
+
+
$wbk->close;
with diagnostics gets
$VAR1 = {
'created' => [
49,
4,
19,
15,
10,
'114',
6,
318,
0
],
'category' => '',
'title' => 'mytitle',
'company' => '',
'status' => '',
'keywords' => '',
'comments' => '',
'author' => '',
'manager' => '',
'subject' => ''
};
Can't call method "get_xf_index" on unblessed reference at
/usr/share/perl5/site_perl/Excel/Writer/XLSX/Worksheet.pm line
+ 6946 (#4)
(F) A method call must know in what package it's supposed to run.
+ It
ordinarily finds this out from the object reference you supply, bu
+t you
didn't supply an object reference in this case. A reference isn't
+ an
object reference until it has been blessed. See perlobj.
Uncaught exception from user code:
Can't call method "get_xf_index" on unblessed reference at /us
+r/share/perl5/site_perl/Excel/Writer/XLSX/Worksheet.pm line 6946.
Excel::Writer::XLSX::Worksheet::_write_cell(Excel::Writer::XLS
+X::Worksheet=HASH(0x3f9ffd0), 0, 0, ARRAY(0x3fa0570)) called at /usr/
+share/perl5/site_perl/Excel/Writer/XLSX/Worksheet.pm line 6685
Excel::Writer::XLSX::Worksheet::_write_rows(Excel::Writer::XLS
+X::Worksheet=HASH(0x3f9ffd0)) called at /usr/share/perl5/site_perl/Ex
+cel/Writer/XLSX/Worksheet.pm line 6600
Excel::Writer::XLSX::Worksheet::_write_sheet_data(Excel::Write
+r::XLSX::Worksheet=HASH(0x3f9ffd0)) called at /usr/share/perl5/site_p
+erl/Excel/Writer/XLSX/Worksheet.pm line 296
Excel::Writer::XLSX::Worksheet::_assemble_xml_file(Excel::Writ
+er::XLSX::Worksheet=HASH(0x3f9ffd0)) called at /usr/share/perl5/site_
+perl/Excel/Writer/XLSX/Package/Packager.pm line 191
Excel::Writer::XLSX::Package::Packager::_write_worksheet_files
+(Excel::Writer::XLSX::Package::Packager=HASH(0x2db7690)) called at /u
+sr/share/perl5/site_perl/Excel/Writer/XLSX/Package/Packager.pm line 1
+28
Excel::Writer::XLSX::Package::Packager::_create_package(Excel:
+:Writer::XLSX::Package::Packager=HASH(0x2db7690)) called at /usr/shar
+e/perl5/site_perl/Excel/Writer/XLSX/Workbook.pm line 936
Excel::Writer::XLSX::Workbook::_store_workbook(Excel::Writer::
+XLSX=HASH(0x3f971c0)) called at /usr/share/perl5/site_perl/Excel/Writ
+er/XLSX/Workbook.pm line 245
Excel::Writer::XLSX::Workbook::close(Excel::Writer::XLSX=HASH(
+0x3f971c0)) called at /home/larry/perl/test/csv2excel.pl line 85
shell returned 25
|