代码:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Row = [Namensfilter].Row And Target.Column = [Namensfilter].Column Then
Dim Displayname As String: Displayname = [Namensfilter].Value + "*"
Dim Map As XmlMap
Set Map = ActiveWorkbook.XmlMaps(1)
Dim urlXML As String
urlXML = "http://direx.corproot.net/DirExWeb/Scripts/Public/GetXML.aspx?displayname=" & Displayname & ""
ThisWorkbook.XmlMaps(Map).ImportXml urlXML
Map.DataBinding.Refresh
End If
End Sub
我想在另一个表中进行XML解析,但是当我导入XML文件时,出现运行时错误9。当我更改
时urlXML = "http://direx.corproot.net/DirExWeb/Scripts/Public/GetXML.aspx?displayname=" & Displayname & ""
ThisWorkbook.XmlMaps(Map).ImportXml urlXML
到
Map.DataBinding.LoadSettings "http://direx.corproot.net/DirExWeb/Scripts/Public/GetXML.aspx?displayname=" & Displayname & ""
或
Map.DataBinding.LoadSettings ("http://direx.corproot.net/DirExWeb/Scripts/Public/GetXML.aspx?displayname=" & Displayname & "")
我遇到了一个非常奇怪的错误,我也发现了here。 如何提供运行时错误9?
答案 0 :(得分:0)
我需要在链接中设置*。
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Row = [Namensfilter].Row And Target.Column = [Namensfilter].Column Then
Dim Displayname As String: Displayname = [Namensfilter].Value
Dim Map As XmlMap
Set Map = ActiveWorkbook.XmlMaps(1)
Dim urlXML As String
urlXML = "http://direx.corproot.net/DirExWeb/Scripts/Public/GetXML.aspx?displayname=" & Displayname & "*"
Map.DataBinding.LoadSettings urlXML
Map.DataBinding.Refresh
End If
End Sub