You forgot to specify the error message you got.
It probably says: Can't locate object method "new" via package "Spreadsheet::ParseExcel" (perhaps you forgot to load "Spreadsheet::ParseExcel"?). Consulting perldiag (or feeding this message to splain, or adding use diagnostics;) yields:
(F) You called a method correctly, and it correctly indicated a package
functioning as a class, but that package doesn't define that particular
method, nor does any of its base classes. See perlobj.
You commented out the code which loads
Spreadsheet::ParseExcel, but you continue to use this module. You need to consult the documentation of
Spreadsheet::XLSX and change your program accordingly.