Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
May 20, 2008, 10:10 am
rate this thread
I am trying to use the perl module Spreadsheet::WriteExcel to create a
new XLS file and write into it, however in my case the name of the xls
file has to be entered by the user and it can not be fixed. So to
achieve this write something like this in my code where $XLSPath is
entered by the user before this line.
#46 my $xlsReport = Spreadsheet::WriteExcel->new($xlsFileName);
However, I get the error
Can't call method "add_worksheet" on an undefined value at line 96 in
c:\report-xls.pl which is
#95 # Create new Worksheet in the workbook
#96 $worksheet = $xlsReport->add_worksheet();
I reckon this means that the variable $xlsReport is undefined which
may be because of some error in line 46. I have seen the examples and
previous question threads and do not find any example in which the
name of the file is a variable. Please help!!