View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
roblo[_4_] roblo[_4_] is offline
external usenet poster
 
Posts: 1
Default Help in adding XML maps to a worksheet using a script


I have been trying to use a script to build, map and populate
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 mappin
elements to the worksheet using drag & drop. The record marco comman
does not record anything on this d & d function. When using d & d t
map elements, it groups these columns together (blue border aroun
perimeter of all the mapped elements/columns), but using the belo
script it creates separate column lists for each column (separate blu
border around each column). This in turn makes it impossible t
export it back to .XML document, getting error when using the "View ma
for export" command.

Here is the script I use for mapping the elements to each column. Bu
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 colum
lists?

Thanks,
Rober

--
robl
-----------------------------------------------------------------------
roblo's Profile: http://www.excelforum.com/member.php...fo&userid=2246
View this thread: http://www.excelforum.com/showthread.php?threadid=39866