I have been trying to use a script to build, map and populate a worksheet in Excel 2003 with a .XML doc and a .XSD map.

I have not been able to mimic in a script what excel does when mapping elements to the worksheet using drag & drop. The record marco command does not record anything on this d & d function. When using d & d to map elements, it groups these columns together (blue border around perimeter of all the mapped elements/columns), but using the below script it creates separate column lists for each column (separate blue border around each column). This in turn makes it impossible to export it back to .XML document, getting error when using the "View map for export" command.

Here is the script I use for mapping the elements to each column. But like I said it maps them as separate Column Lists, a new 2003 feature.

'Map elements into spread sheet
strXPath = "/PowerShift/C1A/Customer_number"
Set xp = worksheet.Range("A1:A2").Offset(1,actColumn).XPath
xp.SetValue workbook.XmlMaps(1), strXPath
actColumn = actColumn + 1
'Map elements into spread sheet
strXPath = "/PowerShift/C1A/Customer_type"
Set xp = worksheet.Range("A1:A2").Offset(1,actColumn).XPath
xp.SetValue workbook.XmlMaps(1), strXPath
actColumn = actColumn + 1

How do I map the elements so they don't appear as separate column lists?

Thanks,
Robert