Jobs
Author: tanakorn wichaiwong Date Submitted: 6/28/2005 Category: Other Compatibility: VB 6 This code has been accessed 6566 times.
Email Yourself this snippet:
Imports System.Xml Imports Microsoft.Office.Interop
Code
Try Dim xml As New XmlDocument xml.Load("C:\bcptable.xml") Dim node As XmlNode Dim list As XmlNodeList list = xml.SelectNodes("//General") Dim app As New Microsoft.Office.Interop.Excel.Application Dim exbook As Microsoft.Office.Interop.Excel.Workbook Dim exsheet As Microsoft.Office.Interop.Excel.Worksheet exbook = app.Workbooks.Add exsheet = exbook.Sheets(1) Dim xx As Integer For Each node In list xx += 1 exsheet.Cells(xx, 1) = node.Attributes("File").Value exsheet.Cells(xx, 2) = node.Attributes("Table").Value Next exbook.SaveAs("C:\took1.xls") app.Visible = True MsgBox("complete") Exit Sub Catch ex As Exception MsgBox(ex.ToString) End Try