Spread...seXLSX(3pm)

๐Ÿ’– NAME ๐Ÿ’–

okay so bestie, this is the manual page for Spreadsheet::ParseXLSX(3pm) โ€” and the actual name-section tea is: Spreadsheet::ParseXLSX - parse XLSX files. That's it, that's the whole vibe โœจ.

๐ŸŒธ VERSION ๐ŸŒธ

version 0.37 โ€” yes ma'am, that's the version ๐Ÿ’….

โญ SYNOPSIS โญ

okay so here's the group-chat-ready starter pack:

use Spreadsheet::ParseXLSX;

my $parser = Spreadsheet::ParseXLSX->new;
my $workbook = $parser->parse("file.xlsx");
# see Spreadsheet::ParseExcel for further documentation

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

This module is an adaptor for Spreadsheet::ParseExcel that reads XLSX files. For documentation about the various data that you can retrieve from these classes, please see Spreadsheet::ParseExcel, Spreadsheet::ParseExcel::Workbook, Spreadsheet::ParseExcel::Worksheet, and Spreadsheet::ParseExcel::Cell ๐Ÿซถ.

๐Ÿ› ๏ธ METHODS ๐Ÿ› ๏ธ

new(%opts) ๐ŸŽ€

Returns a new parser instance. Takes a hash of parameters:

  • Password โ€” password to use for decrypting encrypted files.

parse($file, $formatter) ๐ŸŽ€

Parses an XLSX file. Parsing errors throw an exception. $file can be either a filename or an open filehandle. Returns a Spreadsheet::ParseExcel::Workbook instance containing the parsed data. The $formatter argument is an optional formatter class as described in Spreadsheet::ParseExcel.

๐Ÿ˜ฌ INCOMPATIBILITIES ๐Ÿ˜ฌ

This module returns data using classes from Spreadsheet::ParseExcel, so for the most part, it should just be a drop-in replacement. That said, there are a couple areas where the data returned is intentionally different:

Colors ๐ŸŒˆ

In Spreadsheet::ParseExcel, colors are represented by integers which index into the color table, and you have to use Spreadsheet::ParseExcel->ColorIdxToRGB in order to get the actual value out. In Spreadsheet::ParseXLSX, while the color table still exists, cells are also allowed to specify their color directly rather than going through the color table. In order to avoid confusion, I normalize all color values in Spreadsheet::ParseXLSX to their string RGB format (#0088ff). This affects the Fill, BdrColor, and BdrDiag properties of formats, and the Color property of fonts. Note that the default color is represented by undef (the same thing that ColorIdxToRGB would return).

Formulas ๐Ÿงฎ

Spreadsheet::ParseExcel doesn't support formulas. Spreadsheet::ParseXLSX provides basic formula support by returning the text of the formula as part of the cell data. You can access it via $cell->{Formula}. Note that the restriction still holds that formula cell values aren't available unless they were explicitly provided when the spreadsheet was written.

๐Ÿ› BUGS ๐Ÿ›

Large spreadsheets may cause segfaults on perl 5.14 and earlier ๐Ÿ’€

This module internally uses XML::Twig, which makes it potentially subject to Bug #71636 for XML-Twig: Segfault with medium-sized document (https://rt.cpan.org/Public/Bug/Display.html?id=71636) on perl versions 5.14 and below (the underlying bug with perl weak references was fixed in perl 5.15.5). The larger and more complex the spreadsheet, the more likely to be affected, but the actual size at which it segfaults is platform dependent. On a 64-bit perl with 7.6gb memory, it was seen on spreadsheets about 300mb and above. You can work around this adding XML::Twig::_set_weakrefs(0) to your code before parsing the spreadsheet, although this may have other consequences such as memory leaks ๐Ÿ˜ญ.

Worksheets without the dimension tag are not supported ๐Ÿ™ˆ

Intra-cell formatting is discarded ๐Ÿ’€

Shared formulas are not supported ๐Ÿซ 

Shared formula support will require an actual formula parser and quite a bit of custom logic, since the only thing stored in the document is the formula for the base cell - updating the cell references in the formulas in the rest of the cells is handled by the application. Values for these cells are still handled properly.

In addition, there are still a few areas which are not yet implemented (the XLSX spec is quite large). If you run into any of those, bug reports are quite welcome ๐Ÿซถ.

Please report any bugs to GitHub Issues at https://github.com/MichaelDaum/spreadsheet-parsexlsx/issues.

๐Ÿ‘€ SEE ALSO ๐Ÿ‘€

  • Spreadsheet::ParseExcel โ€” the equivalent, for XLS files.
  • Spreadsheet::XLSX โ€” an older, less robust and featureful implementation.

๐Ÿซถ SUPPORT ๐Ÿซถ

You can find this documentation for this module with the perldoc command.

perldoc Spreadsheet::ParseXLSX

You can also look for information at:

๐Ÿ’ธ SPONSORS ๐Ÿ’ธ

Parts of this code were paid for by Socialflow (http://socialflow.com) โ€” iconic sponsorship behavior, honestly ๐Ÿ‘‘.

๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

Jesse Luehrs <doy@tozt.net>

๐Ÿซถ CONTRIBUTORS ๐Ÿซถ

the besties who helped make this happen:

  • Alex <asb@cpan.org>
  • Alexey Mazurin <mazurin.alexey@gmail.com>
  • Daryl Anderman <daryl@273kelvin.ca>
  • Dave Clarke <david_clarke@verizon.net>
  • Fitz Elliott <felliott@fiskur.org>
  • FL <f20@reckon.co.uk>
  • Gareth Tunley <gjtunley@gmail.com>
  • Meredith Howard <mhoward@roomag.org>
  • Michael Conrad <mike@nrdvana.net>
  • Michael Daum <daum@michaeldaumconsulting.com>
  • Nick Moore <nick.moore@strategicdata.com.au>
  • oharakouhei <gofue0723@gmail.com>
  • rdboisvert <rdbprog@gmail.com>
  • Ricardo Signes <rjbs@cpan.org>
  • Robert Boisvert <robert.boisvert@PABET-J069H12.sncrcorp.net>
  • Steve Simms <steve@deefs.net>
  • Stuart Watt <stuart@morungos.com>
  • theevilapplepie <theevilapplepie@gmail.com>
  • zhouzhen1 <zhouzhen1@gmail.com>

This software is Copyright (c) 2026 by Jesse Luehrs.

This is free software, licensed under:

The MIT (X11) License


okay that's the whole manual, bestie ๐Ÿ’… โ€” footer vibes: perl v5.40.1, date 2026-06-22, and yes, Spreadsheet::ParseXLSX(3pm) again for the road. byeeee ๐Ÿฆ‹โœจ

๐Ÿ“ฆ where this page comes from