Excel: Edit the XML inside an XLSX file

microsoft excelmicrosoft-excel-2007microsoft-officexml

An Excel XLSX file is a zip archive containing several XML files. I tried to extract all the XML files, and edit xl\connections.xml using an XML editor. That's because I have to change 20+ connections to point to a different server.

When I open the edited archive in Excel, it refuses the changes and repairs the file.

Is there a way to edit the XML files inside an XML archive?

Best Answer

How are you going about doing the editing? I would suggest not fully extracting the file, but instead, just opening the archive in 7-zip. Then, find the file you want to edit, choose "edit", then save it and 7-zip should automatically replace it in the archive. In the past when I've done this, Excel has then opened it up without any trouble, but when actually extracting then recompressing it, I've had issues.

Related Question