Victor Charles
asked on
Help with saving xml file as an excel using VB.NET
Hello,
Is there a way to save an xml file as an excel file (.xls/.xlsx)?
Thanks,
Victor
Is there a way to save an xml file as an excel file (.xls/.xlsx)?
Thanks,
Victor
ASKER
Hi,
Looking at your code, where do you include the xml file?
Thanks.
Looking at your code, where do you include the xml file?
Thanks.
what format is your data in right now?
ASKER
It's in xml.
What I meant is what kind of data is it? For example, you can easily export a 2d array of strings and numbers as CSV. If there are charts and graphs, you will have to massage it into the xlsx format.
ASKER
Included in the xml are plain text and numbers, no charts and graphs are included.
Can you open the file in excel directly? I mean, Open | Import XML..
ASKER
Hi,
.
I'm creating the xml file from the application by running a Query and filtering a table, would than like to save the data (results) in excel format.
.
I'm creating the xml file from the application by running a Query and filtering a table, would than like to save the data (results) in excel format.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you.
The XLSX format is very complicated. See here
If you are just saving a table of values, you probably want to just save as a CSV file, which excel natively opens.
If you want to use interop (and you already have excel loaded on the target machines), you'd do somwthing like this
Dim ws As New Microsoft.Office.Interop.E
ws.SaveAs("c:\" & whatever)