Can't read xml to Excel (dataset.WriteXml)

M

Morten Snedker

I'm using this code to generate an XML-file:

If File.Exists("d:\k2b.xls") Then File.Delete("d:\k2b.xls")
Dim fs As New System.IO.FileStream("d:\k2b.xml",
IO.FileMode.CreateNew)

dsP.WriteXml(fs)

fs.Close()
fs.Dispose()


When importing to Excel 2000 (10.0) it shows the entire xml-code (as
if opened with text editor). I'm I doing something wrong?


/Snedker
 
A

Andrew Morton

Morten said:
I'm using this code to generate an XML-file:

If File.Exists("d:\k2b.xls") Then File.Delete("d:\k2b.xls")
Dim fs As New System.IO.FileStream("d:\k2b.xml",
IO.FileMode.CreateNew)

dsP.WriteXml(fs)

fs.Close()
fs.Dispose()


When importing to Excel 2000 (10.0) it shows the entire xml-code (as
if opened with text editor). I'm I doing something wrong?

If you save it with an extension of .xls instead, does Excel then
"understand" it?

Andrew
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top