hi,I'm new to vb.net
how to export XML data from a datagrid to excel sheet?
thanks.
Printable View
hi,I'm new to vb.net
how to export XML data from a datagrid to excel sheet?
thanks.
Welcome to the forums.
Save the XML data out to an XML file. Then you can use the .OpenXML function with ease.
VB Code:
Dim moApp As Excel.Application = DirectCast(CreateObject("Excel.Application"), Excel.Application) '... Dim oWB As Excel.Workbook = moApp.Workbooks.OpenXML("C:\MyXML.xml")
Erm... i don't really get what you mean.Quote:
Originally Posted by RobDog888
I have a XML file, it was first populated to the datagrid then if user wants to view it in excel, it could be exported to the excel sheet using a EXPORT button. Is there any way of exporting the data in the datagrid to excel? :ehh:
You would have to loop through its records and write directly to an Excel instance.
Since you already have the XML file on disk, you could just open it in Excel like I posted when they click the Export button.