Click here to Skip to main content
15,892,674 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need to build xml format, so it will opened with every MS Excel

I tried to using "SpreadsheetDocument.Create", but it wants to create a file, but I don't want to create file. I want to create xml with it and send it to the client, so MS Excel will open it.

How I can do this??

Thank you
Posted

1 solution

There is no magic ingredient required and you don't need to use Office automation to create XML documents.

Here's an intro to XML in Excel[^] (you should understand what it is you will end up with).

All that is required is that you have a valid, conforming XML file. The .NET framework will write this out for you from an object model (look for XML serialization in the .NET framework if you're not familiar with the topic).

Hope this steers you in the right direction.

Cheers.
 
Share this answer
 
Comments
TheAteist 6-Oct-10 15:59pm    
but I don't use Office automation(Microsoft.Office.Interop.Excel). I use Open XML SDK 2.0. Is this them same? Because I read that this format(Open XML) support all ms-excel versions
TheyCallMeMrJames 6-Oct-10 16:04pm    
Sorry I missed the SDK reference, but, no, open XML is a standard for Excel documents for Office 2007 and forward, not all versions (in fact, only two).

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