Unable to use $worbook->Worksheet() method

378 views
Skip to first unread message

Anne

unread,
Feb 18, 2009, 4:21:29 PM2/18/09
to Spreadsheet::ParseExcel
I'm getting the following error:

Can't locate object method "Worksheet" via package
Spreadsheet::ParseExcel::Workbook" at create-prepare-import.pl line
30.

when using $workbook->Worksheet() method.

Summary of simple code:

my $parser = Spreadsheet::ParseExcel->new();
my $workbook = $parser->Parse('ATB.xls');

my $sheetcount = $workbook->{SheetCount};
print "sheetcount:$sheetcount\n"; # I get a correct value
here

my $worksheet = $workbook->Worksheet('New Mapping'); #This is
the line I'm getting error on.

Do you see anything wrong with the code? How can I check that the
Worksheet method is available in my installation?

I have also tried $workbook->worksheets, which also is not working for
me.

Thanks for any help.
Anne


jmcnamara

unread,
Feb 19, 2009, 6:37:03 AM2/19/09
to Spreadsheet::ParseExcel
On Feb 18, 9:21 pm, Anne <abandy...@gmail.com> wrote:
> I'm getting the following error:
>
> Can't locate object method "Worksheet" via package
> Spreadsheet::ParseExcel::Workbook" at create-prepare-import.pl line
> 30.


Hi Anne,

That is a little odd. The Worksheet() method has been there for quite
a while.

Post the output from the versions program in the following FAQ and we
can see what is going on:

http://groups.google.com/group/spreadsheet-parseexcel/browse_frm/thread/c759ffd42612a653?hl=en

John.
--

Anne

unread,
Feb 27, 2009, 10:56:46 AM2/27/09
to Spreadsheet::ParseExcel
I appreciate your quick reply. I'm sorry about very late reply -- due
to family emergency across the country. My responses may continue to
be delayed.

I am running cqperl (IBM's ClearQuest perl version. I have added the
Spreadsheet package to our library directory which is in @INC, but as
you can see, much appears to be wrong. Here is the system info, as
per the posted program.

Thanks,
Anne
> http://groups.google.com/group/spreadsheet-parseexcel/browse_frm/thre...
>
> John.
> --

Anne

unread,
Feb 27, 2009, 11:00:34 AM2/27/09
to Spreadsheet::ParseExcel
Well... HERE is the promised system info. Even though it says that
Spreadsheet::ParseExcel is not installed, I am able to use some of its
functions.

Perl version : 5.008006
OS name : MSWin32
Module versions: (not all are required)
Spreadsheet::ParseExcel (not installed)
Scalar::Util 1.14
Unicode::Map (not installed)
Spreadsheet::WriteExcel (not installed)
Parse::RecDescent (not installed)
File::Temp 0.14
OLE::Storage_Lite (not installed)
IO::Stringy (not installed)
> > --- Hide quoted text -
>
> - Show quoted text -

jmcnamara

unread,
Mar 1, 2009, 1:49:45 PM3/1/09
to Spreadsheet::ParseExcel


On Feb 27, 4:00 pm, Anne <abandy...@gmail.com> wrote:
> Well... HERE is the promised system info.  Even though it says that
> Spreadsheet::ParseExcel is not installed, I am able to use some of its
> functions.
>
>     Perl version   : 5.008006
>     OS name        : MSWin32
>     Module versions: (not all are required)
>                      Spreadsheet::ParseExcel    (not installed)


Hi Anne,

I'd suspect that all of the Spreadsheet::ParseExcel sub-modules aren't
included in your @INC, i.e., all of the modules in the lib dir of the
distro:

http://search.cpan.org/~jmcnamara/Spreadsheet-ParseExcel-0.49/MANIFEST

Either that or that the version of Spreadsheet::ParseExcel that is
installed is very old.

John.
--

Anne

unread,
Mar 3, 2009, 9:19:19 PM3/3/09
to Spreadsheet::ParseExcel
ok. Thanks for the Manifest. I will investigate and see if I can
correct this. It shouldn't be all >that< hard.
Anne

Anupam

unread,
Apr 20, 2009, 12:01:45 PM4/20/09
to Spreadsheet::ParseExcel
I have come across the same issue and it resolved when I created the
new excel sheet and copied the data from my old excel. My old excel
sheet data I extracted from db2 using db2 Client and saved in excel
format. I think perl is having some problem reading the data that is
written/saved to excel through some kind of utility (db2 Client or
teradata sql assistant). It's better to copy the data in new excel and
then use Spreadsheet::ParseExcel to read/parse excel.
Reply all
Reply to author
Forward
0 new messages