1
我想从API XML数据拉的Excel中创建数据表。在下面的代码之前,我做了API调用,下面的第一行用XML数据提供了一个msgbox(以便部分看起来正在工作)。Excel VBA XML - 文档未加载
MsgBox httpReq.responseText
Dim xDoc As MSXML2.DOMDocument
Set xDoc = New MSXML2.DOMDocument
xDoc.async = False
xDoc.validateOnParse = False
If xDoc.Load(httpReq.responseText) Then
'Do something
Else
MsgBox "Document failed to load."
End If
不幸的是,我然后继续击中If/Then(即文档未加载)的Else方。我的语法错了吗?在我的研究工作中,似乎.Load()的参数通常是一个文件或URL - 我可以不使用httpReq.responseText代替文件名或URL吗?
真棒!非常感谢! – rryanp 2015-03-13 17:12:28