Click here to Skip to main content
15,891,473 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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.

Thanks,
Kiran
Posted
Comments
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: http://en.wikipedia.org/wiki/Microsoft_Excel
Sergey Alexandrovich Kryukov 19-Feb-13 15:17pm    
From my answer, it should be clear that the format is already XML, zipped — please see.
—SA
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. :-)
—SA
Maciej Los 19-Feb-13 15:40pm    
Yes, that's because i'm not sure what OP wants to ask.

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:
http://en.wikipedia.org/wiki/Office_Open_XML_file_formats[^],
http://en.wikipedia.org/wiki/Office_Open_XML[^].

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

[EDIT]

For working with ZIP, you can use #ziplib:
http://www.icsharpcode.net/opensource/sharpziplib/[^].

Another option is using SevenZipSharp, a .NET wrapper of the famous 7-Zip:
http://en.wikipedia.org/wiki/7-Zip[^],
http://sevenzipsharp.codeplex.com/[^].

Both ZIP libraries are open-source.

Good luck,
—SA
 
Share this answer
 
v2
Comments
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.
—SA
Maciej Los 19-Feb-13 17:01pm    
The answer is complete now ;)
+5!
Sergey Alexandrovich Kryukov 19-Feb-13 17:07pm    
Thank you very much, Maciej.
Another very funny answer is almost ready, take a look...
—SA
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 :-).
—SA
See whether his article can help
Generate Excel from XML and Generate XML from Excel[^]
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900