We can get content from office 2007 file with adding .zip of the file. But if I set workbook protection, I will get "The compressed (zipped) folder is invalid or corrupted" if I open add .zip to excel 2007 file and open it in windows explorer. Could you tell me the reason I can't open it? is it related with encrypt mechanism of excel 2007? why I can open it if I set "Sheet Protect"?
And then I tested in excel 2010, I found I can get the correct content for "workbook protection", is there some difference for these two versions?
I got some information from MSDN: http://social.msdn.microsoft.com/Forums/en-US/officegeneral/thread/3adab393-4bb7-467f-becd-127583aa925f, but not get the answer why I can open it in excel 2010. Could you help me?
Either I or Bob McClellan will research this, get back to you.
Greetings, just adding to the thread as I have this exact issue as well.
When workbook structure protection is enabled, the resulting .zip file is non-standard I've tried opening it in gzip, 7-zip, winzip, windows compressed folder nothing works. I somewhat suspect the integrity hash is off since the data is there and Excel can read it, just not any standards-compliant zip utilities.
A quick server-side save to Office 2010 thru Interop solves it but defeats the objective of using OpenXML as the preferred methodology for reading/writing Excel server side.
Any intelligence, ideas, comments welcome!
Some further information for anyone else having this issue so perhaps you don't have to go down the same road:
It occurred to me to try zip repair utilities to see if that would be an alternative to an Excel 2010 resave. Of course, sucesss depends on the nature of the corruption that the file contains and what that looks like to zip utilities.
I tried WinZip 16's command line repair utility, a seperate download available from the WinZip site.
Alas, the issue seems to be in the central directory header and this Repair utility was not able to correct the corruption in my Excel 2007 file.
See results below:
C:\ExcelWinZipTest>"C:\Program Files\WinZip\wzzip" -yf 30335_1zip.zip
WinZip(R) Command Line Support Add-On Version 3.2 (Build 9715)
Copyright (c) 1991-2011 WinZip International LLC - All Rights Reserved
fixing Zip file 30335_1zip.zip
Warning: end-of-central-directory header not found
Warning: 30335_1zip.zip not found or empty
creating Zip file 30335_1zipFIXED.zip
Zip file: 30335_1zipFIXED.zip
Warning [30335_1zipFIXED.zip]: Zip file is empty
"When workbook structure protection is enabled, the resulting .zip file is non-standard"
When protection is enabled the resulting file is no longer in Zip format but is instead an OLE compound document with encrypted sub-documents.
You may fix your .zip file owing to
tool also works with big/huge .zip archives, it must help you