I am looking for a way to open and populate a new sheet while population the sheet from a file.xml.
Any ideas?
Thanks
I am looking for a way to open and populate a new sheet while population the sheet from a file.xml.
Any ideas?
Thanks
Imports Microsoft.Office.Interop.Excel
Public Class ReadExcel
Public Sub OpenDoc(ByVal Filename As String)
Dim excelApp As New Microsoft.Office.Interop.Excel.Application
excelApp.Workbooks.OpenXML(Filename)
' do something here...
End Sub
End Class
In addition to what Derek Tomes has answered, you can specify the loading options for the openXML method.
You may use xlXmlLoadImportToList to open a new workbook with the xml data you want to load or you may use xlXmlLoadOpenXml to open the xml file itself in excel.
you can hide the alerts with the DisplayAlerts property set to false when loading your xml then just set it to true afterwards.