runtime error '-2147467259 (80004005)
Hi,
i'm getting a runtime error '-2147467259 (80004005)' The XPath is not valid because either XPath syntax is incorrect or not supported by Excel.
My code is:
Sub Temp()
Dim ws As Worksheet
Dim xmap As XmlMap
Dim oList As ListObject
Dim colList As ListColumn
Dim strXPath As String
Set ws = ActiveWorkbook.Sheets("Sheet1")
Set xmap = ActiveWorkbook.XmlMaps("Taxonomy_Map")
' Create a list object.
Set oList = ws.ListObjects.Add(xlSrcRange, [A1])
' Add a column to the list.
Set colList = oList.ListColumns.Add
' Map the column to an element in an XML map.
oList.ListColumns(1).XPath.SetValue xmap, "//Level[text()]", , True
' Repeat for two more columns.
Set colList = oList.ListColumns.Add
oList.ListColumns(2).XPath.SetValue xmap, "//Taxonomy/uri/taxonomyName/versionNumber/isCurrent/taxonomyClassificationCode/definingOrg/xmlNamespacePrefix/description/updateTime/MetricDefPresList/MetricDefPres/MetricDefNum/Level/Order", , True
Set colList = oList.ListColumns.Add
oList.ListColumns(3).XPath.SetValue xmap, "//Taxonomy/uri/taxonomyName/versionNumber/isCurrent/taxonomyClassificationCode/definingOrg/xmlNamespacePrefix/description/updateTime/MetricDefPresList/MetricDefPres/MetricDefNum/Level/Order/Taxonomy/TagName", , True
End Sub
i've also tried by added 'Microsoft XML, v3.0' ,'Microsoft XML, v4.0' and 'Microsoft XML, v5.0'
Please help...
Thanks,
sonal
|