ycphs / openxlsx

openxlsx - a fast way to read and write complex xslx files
https://ycphs.github.io/openxlsx/
Other
220 stars 74 forks source link

loadWorkbook throws error when existing sheet in workbook contains the character ">" #399

Closed ammar-gla closed 8 months ago

ammar-gla commented 1 year ago

At some point during the loadWorkbookprocess, there is a regex which reads the ID of each sheet as being contained between the strings "<sheet" and ">": <sheet[^>]*>

This works fine with most sheet names which would have a character string as the one below: <sheet name=\"Summary\" sheetId=\"3\" state=\"visible\" r:id=\"rId1\"/>

However, when the sheet name contains the character ">", the regex erroneously cuts most of the string, such as the example: <sheet name=\"Data->\" sheetId=\"4\" state=\"visible\" r:id=\"rId2\"/>

This means that e.g. the string rId2 is lost, which leads to a "subscript out of bounds" error later on.

The loadWorkbookcommand should either be amended to allow the character ">" within the sheet name, or it should warn the user that the sheet name is not allowed.

github-actions[bot] commented 8 months ago

This issue is stale because it has been open 365 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] commented 8 months ago

This issue was closed because it has been stalled for 7 days with no activity.