in reply to Spreadsheet::ParseXLSX or Spreadsheet::ParseExcel doesn't work with .xlsx

You did not post enough details to spot the problem.

More in general, you cannot use Spreadsheet::ParseExcel to parse xlsx, for which you need Spreadsheet::ParseXLSX, which has the same API as Spreadsheet::ParseExcel.

Did you consider using Spreadsheet::Read? It can decide itself which underlying parser to use and offers a unified interface to a variety of spreadsheet formats.

Spreadsheet::Read offers xlscat with options, so you can only show certain sheets, columns, and/or rows and xlsgrep to find patters in spreadsheets.

Enjoy, Have FUN! H.Merijn
  • Comment on Re: Spreadsheet::ParseXLSX or Spreadsheet::ParseExcel doesn't work with .xlsx
  • Download Code

Replies are listed 'Best First'.
Re^2: Spreadsheet::ParseXLSX or Spreadsheet::ParseExcel doesn't work with .xlsx
by farahk22 (Initiate) on Oct 20, 2020 at 02:25 UTC
    To use Spreadsheet::Read, do I need to install Spreadsheet::ParseExcel as well? I have already installed Spreadsheet::Read but it seems that my script does not load any data from the excel file

      You need to have the real parser installed. Spreadsheet::Read is just a unifying frontend API to all the supported parsers. This is like using DBI without knowing what DBD is used: your programm does use DBI; and DBI->connect decides what DBD to load. Likewise for Spreadsheet::Read.

      So to parse .xslx you have to install Spreadsheet::ParseXLSX and then you do somthing like:

      use strict; use warnings; use Spreadsheet::Read; my $book = Spreadsheet::Read->new ("file.xlsx"); my $sheet = $book->sheet (1); my $a3 = $sheet->cell ("A3");

      Enjoy, Have FUN! H.Merijn
        Thank you for the answer!