I am working with XML data exported from a database into Excel. I have a externally created .XSD map that I would like to map to cells in a new spread sheet. I tried using the recorder to minic the VB code that I would need to create it, but it does not record the mapping process which is done with a drag and drop.

Currently my code sucessfully adds the .XSD map to my spread sheet. But I can't figure out how to map the ROOT to a cell. With drag and drop I just move the root over to cell A1 and it creates the columns with the .XSD specifics. How do I map the ROOT to cell A1 in VB code. I am stumped.

set xapp = WScript.CreateObject("Excel.Application")
xapp.Visible = True

' Make a new Excel workbook:
set workbook = xapp.Workbooks.Add
set worksheet = workbook.Worksheets("sheet1")

workbook.XmlMaps.Add("c:\junk.xsd"),"junk"

Set xp = worksheet.Range("B2").XPath
xp.SetValue Workbook.XmlMaps(1), "/junk/master/Customer_number"
msgbox worksheet.Range("B2").XPath.Value

Set xmpCustomMap = workbook.XmlMaps(1)