1

I am looking into the various options of generating Office documents on a server, in particular Excel documents.

The site isn't important but what is relevant is that it used the MS open XML library listed below. I checked out the article on Open Office here:

http://www.codeproject.com/Articles/97307/Using-C-and-Open-XML-SDK-2-0-for-Microsoft-Office

This project seems to set a reference to an openXML library

C:\Program Files\Open XML SDK\V2.0\lib\DocumentFormat.OpenXml.dll 

that is part of the Open XML SDK 2.5 for Microsoft Office.

When I ran the project, the code produced a file that XLSX extension that appeared to be in binary format, not XML format. Similarly, I have seen other Open Office coding examples the file read was a binary format, instead of a file in XML format. For example, when I open up the file in Note, I see "unreadable" characters rather than tags.

Isn't the whole point of Open office XML to read and write XML documents that are in an open format?

Chad
  • 23,658
  • 51
  • 191
  • 321
  • 4
    This might help: http://stackoverflow.com/questions/4886027/xlsx-xml-format I guess it's essentially a zip file. – Adam Miller Feb 21 '14 at 23:04
  • 1
    Unzip them with 7zip, they're actually a whole folder hierarchy of XML files and other resources. – Mike Christensen Feb 21 '14 at 23:06
  • Instead of changing the extension to see the XML of the docx files, use the [Open XML Productivity Tool](http://www.microsoft.com/en-in/download/details.aspx?id=30425) that can be downloaded along with the Open XML SDK. – Varun Rathore Feb 25 '14 at 10:21

1 Answers1

3

Change the file extension to zip and try again.

Oscar
  • 13,594
  • 8
  • 47
  • 75
  • I have a related problem. I have generated an Open XML document using Ruby on Rails. I am able to open the generated XML in notepad and view the XML which looks all good. But I am not able to open it in Excel software. Would you be able to help me with this please? I have posted the issue in detail here - https://stackoverflow.com/questions/56038034/how-to-save-and-open-an-open-xml-document-as-excel-file Pls help! – Biju May 09 '19 at 03:05
  • If you could ignore the Ruby on Rails aspect and just give some pointers as to how to save an Open XML document as Excel, that'd be VERY helpful starter! Currently I have no clue what am missing. – Biju May 09 '19 at 03:07