Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-19-2016, 12:59 PM
dww dww is offline How to recreate excel .xlsx file from unzipped xml folder Windows 10 How to recreate excel .xlsx file from unzipped xml folder Office 2016
Novice
How to recreate excel .xlsx file from unzipped xml folder
 
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
  #2  
Old 10-19-2016, 04:12 PM
macropod's Avatar
macropod macropod is offline How to recreate excel .xlsx file from unzipped xml folder Windows 7 64bit How to recreate excel .xlsx file from unzipped xml folder Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

The process you described works fine for me using WinZip with its default settings. I have no experience with 7-zip.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 10-19-2016, 04:15 PM
dww dww is offline How to recreate excel .xlsx file from unzipped xml folder Windows 10 How to recreate excel .xlsx file from unzipped xml folder Office 2016
Novice
How to recreate excel .xlsx file from unzipped xml folder
 
Join Date: Oct 2016
Posts: 4
dww is on a distinguished road
Default

Updated question to note that I've tried with a few different zip tools -all with the same result
Reply With Quote
  #4  
Old 10-19-2016, 04:19 PM
dww dww is offline How to recreate excel .xlsx file from unzipped xml folder Windows 10 How to recreate excel .xlsx file from unzipped xml folder Office 2016
Novice
How to recreate excel .xlsx file from unzipped xml folder
 
Join Date: Oct 2016
Posts: 4
dww is on a distinguished road
Default

@Macropod Thanks for trying - I've attempted this now with WinZip, 7zip and PeaZip - all with the same result. What version of Excel are you using? Could it be related to the excel version perhaps?
Reply With Quote
  #5  
Old 10-19-2016, 04:32 PM
macropod's Avatar
macropod macropod is offline How to recreate excel .xlsx file from unzipped xml folder Windows 7 64bit How to recreate excel .xlsx file from unzipped xml folder Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

As my profile indicates, I'm using Office 2010. That isn't the issue, however, as both is and Office 2016 use the same file format. Apparently, you're not recreating a zip file with exactly the same contents and structure as the original.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #6  
Old 10-20-2016, 09:34 AM
dww dww is offline How to recreate excel .xlsx file from unzipped xml folder Windows 10 How to recreate excel .xlsx file from unzipped xml folder Office 2016
Novice
How to recreate excel .xlsx file from unzipped xml folder
 
Join Date: Oct 2016
Posts: 4
dww is on a distinguished road
Default

Ok I finally managed to solve this myself. The key is that when recreating the zip file, you must zip the contents of the unzipped folder. Not the folder itself!
Reply With Quote
Reply

Tags
xml zip



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create microsoft Excel 2007 and 2010 File in .xlsx format ipacesetters Excel 1 12-16-2019 05:13 PM
How to recreate excel .xlsx file from unzipped xml folder Excel does not work if any other excel file selected in any folder tonytonytony Excel 3 03-10-2016 04:18 PM
Excel connot open file (filename) xlsx dengeorge6 Excel 0 12-12-2014 01:36 AM
XLSX file won't open when clicked MikeyChris Excel 9 09-20-2013 07:55 AM
How to recreate excel .xlsx file from unzipped xml folder excel cannot open the file .xlsx because the file format or file extension is not val teddysika Excel 1 11-22-2012 06:06 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:50 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft