Click here to Skip to main content
12,625,355 members (40,197 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# XML MS-Excel
Hi All,

I want to create a basic application that browses a excel document and converts its contents into a xml format, any help would be helpful.

Posted 19-Feb-13 9:54am
Maciej Los 19-Feb-13 15:00pm
Please, provide more details. Did you know that Excel 2007 - 2010 files are based on xml files? See this:
Sergey Alexandrovich Kryukov 19-Feb-13 15:17pm
From my answer, it should be clear that the format is already XML, zipped — please see.
Maciej Los 19-Feb-13 15:25pm
I knew it, Sergey. I was first with my comment, than you with your answer ;)
Sergey Alexandrovich Kryukov 19-Feb-13 15:34pm
But you did not answer on the file formats. :-)
Maciej Los 19-Feb-13 15:40pm
Yes, that's because i'm not sure what OP wants to ask.
Sergey Alexandrovich Kryukov 19-Feb-13 15:49pm
Well, I'm not even sure OP understands what she/he wants...
Maciej Los 19-Feb-13 16:34pm
Agree ;)
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

There is no such thing as just "XML format". XML is a kind of a media for many formats. This way, the question does not have a full sense. I just want to bring to your attention that an .XLSX Excel document is already XML; you only need to unpack the file, which is actually is a ZIP format. You can learn about the format here:[^],[^].

What you are going to do with that is your business. From your question, I'm not sure you really know what.


For working with ZIP, you can use #ziplib:[^].

Another option is using SevenZipSharp, a .NET wrapper of the famous 7-Zip:[^],[^].

Both ZIP libraries are open-source.

Good luck,
Maciej Los 19-Feb-13 16:34pm
What about Excel 1997-2003, XP file formats?
Sergey Alexandrovich Kryukov 19-Feb-13 16:58pm
If anyone needs that, it's solvable. The source code of LibreOffice and OpenOffice is available; they can use those files. The code can be written in C# or wrapped using P/Invoke or C++/CLI. That's the solution.
Maciej Los 19-Feb-13 17:01pm
The answer is complete now ;)
Sergey Alexandrovich Kryukov 19-Feb-13 17:07pm
Thank you very much, Maciej.
Another very funny answer is almost ready, take a look...
Sergey Alexandrovich Kryukov 19-Feb-13 17:17pm
And to make it more complete, I added the advice on how to work with ZIP (mostly because another question was about JAR, which is also ZIP :-).
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

See whether his article can help
Generate Excel from XML and Generate XML from Excel[^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.161128.1 | Last Updated 19 Feb 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100