tags:

views:

148

answers:

2

Hi all. I have an Excel spreadsheet that looks like:

spreadsheet

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#?

A: 

try File | Save As, filetype .xml

Richard
This XML is probably too verbose, and probably considers the data to be rows/columns instead of usernames, email addresses, and addresses. Might be a good first step, however; transforming XML trees is pretty easy.
jrockway
@jrockway - the question has been tidied up now, it is now clear he wants a c# implementation, so my answer is irrelevant - but yes, i guess the native output would be verbose, and not configurable
Richard
A: 

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().

dbemerlin
Not Work code your link
Oraclee
Not Work English your comment.
jrockway