I'm trying to convert a folder of xml that was created by unzipping an excel file back into an excel .xlsx. But I get the error
The workbook cannot be opened or repaired by Microsoft Excel because it is corrupt
A minimal reproducible example to generate this error:
test.xlsx
test.zip
test.zip
as a folder named test
test
into test_new.zip
test_new.zip
as test_new.xlsx
test_new.xlsx
with ExcelFor zipping and unzipping I have used 7zip, WinZip and PeaZip, all with the same result. What am I doing wrong, and how can I turn unzipped excel workbooks back into their original form?
I managed eventually to find the solution to this myself. The key is that when creating the new zip file, it is necessary to only add the contents of the unzipped folder into the archive. Not the whole folder itself!