Home » excel » How do I convert an XLS document to XML in C#?

How do I convert an XLS document to XML in C#?

Posted by: admin May 14, 2020 Leave a comment

Questions:

I have an Excel spreadsheet that looks like:

spreadsheet http://img186.imageshack.us/img186/6495/exelf.jpg

I’d like to convert this to some XML that looks like:

<UserName>
bla1
</UserName>
<Mail>
bla1[at]bla2.com
</Mail>
<Address>
World
</Address>

can anyone help me do this in C#?

How to&Answers:

Take a look at this Google result:
http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/b6e8a28c-6760-4e86-a1aa-e2ce9ec36380

Read the Excel file into a DataTable and use DataTable.WriteXml().

Answer:

try File | Save As, filetype .xml