views:

250

answers:

3

I have a macro enabled work book and i change the name of the .xlsm file to [FileName].xlsm.zip and then i unzip i get some folders I then put these extracted folders in to another folder and zip it back and rechange the extension to the previous xlsm format i now try and open but i get an unreadable error. I am not changing any content here just extracting and zip it back. What could be the problem?

A: 

"""i unzip i get some folders I then put these extracted folders in to another folder and zip it back"""

If that means that you rearranged the file/folder hierarchy within the xlsm file, it's not surprising that that you got an "unreadable error". Short answer: don't do that. What are you trying to achieve?

[added later] If it's the "winzip" problem, you may like to try 7-Zip (http://www.7-zip.org/).

I was able to do the following: create very small (2 cells) xlsx with Excel 2007, open file with 7-Zip, drill down to the shared strings xml component, hit F4 -- opens file with Notepad for editing (presumably can configure another editor), change text that appears in the two cells, save from Notepad, exit Notepad, 7-Zip detects change, asks if I want to update the archive, I say yes, archive updated, exit 7-Zip, open updated archive aka xlsx with Excel 2007, no complaints, text changes appear correctly.

John Machin
A: 

Okay, I've done this exact same thing with .xlsx files (I had to do a presentation about the format, so I needed to learn the file structure). Don't use WinZip. I've only been able to successfully 're-zip' the files using Windows' built-in Compressed (zipped) Folders utility. It's cumbersome (you have to copy the file out of the .zip archive, and then paste it back in using the Explorer browser when you're done, instead of re-zipping the entire archive in the end), but it works.

cmptrgeekken
A: 

Winzip works just fine as long as your excel file isn't protected. The trick is that you can't zip the folder that holds all the unzipped xml. Instead you have to open that folder, select everything inside it and zip your selection.

Alternatively, if you have winzip's command line functionality installed you can use the following to zip and unzip.

wzunzip -d test.xlsx unzipped_test\

and

wzzip -p -r test.xlsx unzipped_test
Mischa