【问题标题】:Compile Error: Function call on left-hand side of assignment must return Variant or Object编译错误:赋值左侧的函数调用必须返回 Variant 或 Object
【发布时间】:2014-11-15 05:28:59
【问题描述】:

我正在尝试加载 XML 文件,我正在使用 XML 6.0 参考库。

错误发生在“xDom.load”行(见下文)。问题可能是什么?

Private Sub run() ' run the whole operation

Dim http_req As http_req: Set http_req = New http_req
Dim xDom As MSXML2.DOMDocument60

Dim url As String: url = "http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml"

Set xDom = New MSXML2.DOMDocument60
xDom.Load = "http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml"

Call find_ClassElement(xDom)

End Sub

【问题讨论】:

    标签: xml vba excel xmlhttprequest


    【解决方案1】:

    自从我在 Delphi 中做过短暂的工作以来,我没有使用过 msxml,但我认为 Load 是方法调用。您正在尝试将 Load 的引用设置为字符串。试试

    xDom.Load("http://www.ecb........")
    

    【讨论】:

      猜你喜欢
      • 2018-12-23
      • 1970-01-01
      • 1970-01-01
      • 2013-04-15
      • 1970-01-01
      • 1970-01-01
      • 2012-06-29
      • 2018-08-10
      • 2012-07-06
      相关资源
      最近更新 更多