views:

109

answers:

0

Hi,

I have an XML schema and an XML data file. I've implemented it in Excel and it works great.

I want to Automate the process using vb.

I want to open the xls file, the schema is already mapped in the file. then I want to import the XML data file and print a selected working sheet.

this is the code that I have to open the file and the working sheet:

 Dim oXL As Microsoft.Office.Interop.Excel.Application
 Dim oWb As Microsoft.Office.Interop.Excel.Workbook
 Dim oSheet As Microsoft.Office.Interop.Excel.Worksheet

 oXL = CreateObject("Excel.Application")
 oXL.Visible = True

 oWb = oXL.Workbooks.Open("c:\test.xlsm")
 oSheet = oWb.Worksheets("Customer Profile")