Home All Groups Group Topic Archive Search About

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

Author
6 Apr 2006 7:32 AM
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

Author
6 Apr 2006 10:04 AM
Andrew Morton
Morten Snedker wrote:
Show quoteHide quote
> 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