Closed ryan-ambrose-gc closed 10 months ago
Actually, found a perhaps better solution. openpyxl is a package available on all platforms that can read .xlsx files and requires minimal changes to the sheets data part. I intend on submitting a pull request later today where I replace the problematic calls to xlrd with openpyxl.
Description
SheetParts are unable to read data from .xlsx files due to the third-party library xlrd method _openworkbook. Starting with xlrd version 2.0.0, support for .xlsx files was dropped for security vulnerabilities. If an .xlsx spreadsheet is attempted to be read using the _read_fromexcel method, an erroneous error message reporting
"read_from_excel() error. Invalid sheet name. File: {}, Sheet: {}"
is returned due to an XLRDError being raised in the try block of _read_fromexcel (consult sheet_part.py, starting at line 347). However, if the excel spreadsheet is converted to the .xls format, the spreadsheet will be read without issue.
Potential Solutions
Recreate
link.sheet.read_excel(get_scenario_path() + 'Temp.xlsx', 'temp', 'A1:B2')