5

I want to manipulate Office Open XML format of Excel, but even just conversion between the .zip and .xlsx generates errors:

  1. create a very simple test.xlsx by Excel
  2. Right-click test.xlsx => Rename as text.xlsx.zip
  3. Right-click text.xlsx.zip => Extract all to a folder named text.xlsx
  4. Right-click text.xlsx folder => Send to => Compressed (zipped) folder named text_2.xlsx.zip
  5. Right-click text_2.xlsx.zip => Rename as text_2.xlsx
  6. open text_2.xlsx with Excel, then I got the following errors:

enter image description here enter image description here

Does anyone know what's wrong there?

SoftTimur
  • 5,630
  • 38
  • 140
  • 292

2 Answers2

6

Xlsx files are just ordinary zip file and it is definitely possible to do what you are trying to do.

Does anyone know what's wrong there?

I would guess step 4:

  1. Right-click text.xlsx folder => Send to => Compressed (zipped) folder named text_2.xlsx.zip*

You will need to zip the contents on the folder and not the folder itself. The resultant zip file should have the [Content_Types].xml files at the top level with no parent folder.

enter image description here

jmcnamara
  • 38,196
  • 6
  • 90
  • 108
3

.***x files are zip files, but the method of compression is different than the standard one used by Windows Explorer. Windows Explorer does absolute compression (whatever it can compress safely, it will), MS Office and OpenXML leaves necessary pieces uncompressed to be used by the application when it is read.

Edit: I should add that you can zip the files back up and use them as an xlsx again but you have to make sure you're using the same compression method as Excel or OpenXML.

Thecor
  • 118
  • 1
  • 10