Invalid Excel document format
I have a macro enabled workbook and I change the name of the .xlsm file to [FileName] .xlsm.zip and then I unzip, I get some folders Then I put these extracted folders in another folder and zip it back and change the extension to the previous xlsm format, which I am currently trying to open, but I get an unreadable error. I'm not changing any of the content here, just pulling it out and zipping it back up. What could be the problem?
Winzip works fine as long as your excel file is not protected. The trick is that you cannot zip the folder where all the unpacked xml is stored. Instead, you need to open that folder, select everything inside, and pin your selection.
Alternatively, if you have the winzip command line functionality installed, you can use the following command for zip and unzip.
wzunzip -d test.xlsx unzipped_test\
and
wzzip -p -r test.xlsx unzipped_test
a source to share
"" I unzip, I get multiple folders and then I put those extracted folders in another folder and zip them back up "" "
If this means that you changed the file / folder hierarchy in the xlsm file, it is not surprising that you received an "unreadable error". The short answer is: don't do it. What are you trying to achieve?
[added later] If this is a winzip issue, you can try 7-Zip ( http://www.7-zip.org/ ).
I was able to do the following: create a very small (2 cells) xlsx using Excel 2007, open the file with 7-Zip, go to the xml component of the shared sections, press F4 - open the file with Notepad for editing (presumably another editor can tweak) , change the text that appears in two cells, save from Notepad, exit Notepad, 7-Zip detects changes, asks if I want to update the archive, I say yes, the archive is updated, 7-Zip will be released, open updated aka xlsx archive with Excel 2007, no complaints, text changes are displayed correctly.
a source to share
Okay, I did the same with .xlsx files (I needed to make a presentation about the format, so I needed to study the file structure). Don't use WinZip. I was able to successfully "re-zip" the files using the built-in Windows Folders Compressed (ZIP) utility. It's cumbersome (you need to copy the file from the .zip archive and then paste it back in with Explorer when you're done, instead of eventually re-zipping the entire archive), but it works.
a source to share