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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.