From bcfda35b423fcb5c278babb7f72f21c3cc7c58d4 Mon Sep 17 00:00:00 2001 From: Gonzalo Date: Sat, 31 May 2025 19:05:57 -0300 Subject: [PATCH] Avoid error importing spreadsheet with deleted sheet (#19757) This fix was proposed by pageeddie on https://github.com/FreeCAD/FreeCAD/issues/19757 --- src/Mod/Spreadsheet/importXLSX.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Mod/Spreadsheet/importXLSX.py b/src/Mod/Spreadsheet/importXLSX.py index eecdb3a859..2b06bfa45e 100644 --- a/src/Mod/Spreadsheet/importXLSX.py +++ b/src/Mod/Spreadsheet/importXLSX.py @@ -372,8 +372,8 @@ def handleWorkBook(theBook, sheetDict, Doc): nameRef = sheetAtts.getNamedItem("name") sheetName = getText(nameRef.childNodes) # print("table name: ", sheetName) - idRef = sheetAtts.getNamedItem("sheetId") - sheetFile = "sheet" + getText(idRef.childNodes) + ".xml" + idRef = sheetAtts.getNamedItem("r:id") + sheetFile = "sheet" + getText(idRef.childNodes)[3:] + ".xml" # print("sheetFile: ", sheetFile) # add FreeCAD-spreadsheet sheetDict[sheetName] = (Doc.addObject("Spreadsheet::Sheet", sheetName), sheetFile)