View Single Post
 
Old 10-19-2016, 12:59 PM
dww dww is offline Windows 10 Office 2016
Novice
 
Join Date: Oct 2016
Posts: 4
dww is on a distinguished road
Question How to recreate excel .xlsx file from unzipped xml folder

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

The actual file I want to recreate is a fairly large macro-enbled .xlsm spreadsheet created with Excel 2016. I am using the xml format to archive in a git repository in order to provide version control. However, restoring a version from the archive requires that I can reverse the process.

However, a minimal example with a simple spreadsheet also reproduces this issue.

**A minimal reproducible example to generate this error:**

1. Create a new blank spreadsheet in Excel
2. Enter "test" in cell A1
3. Save as `test.xlsx`
4. Rename file to `test.zip`
5. Unzip `test.zip` as a folder named `test`
6. Compress `test` into `test_new.zip`
7. Rename `test_new.zip` as `test_new.xlsx`
8. Open `test_new.xlsx` with Excel

I am using Excel 2016. For zipping/unzipping I've tried 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?

Last edited by dww; 10-19-2016 at 04:17 PM.
Reply With Quote