在我的电子表格中,我引用了MS XML v3库。
这是我的示例代码
Option Explicit
Private objConn As XMLHTTP30
Public Sub HandleAsyncEvent()
Debug.Print "Done"
End Sub
Public Function InitService(serviceUrl As String, Optional asyncMode As Boolean = True)
Set objConn = New XMLHTTP30
objConn.Open "POST", serviceUrl, asyncMode
objConn.setRequestHeader "Content-Type", "text/xml"
objConn.onreadystatechange = HandleAsyncEvent
End Function
当涉及到行
时遇到了运行时异常objConn.onreadystatechange = HandleAsyncEvent
Excel抛出异常“需要对象”
实际上是否可以将函数传递给onreadystatechange
?我可以在excel vba中传递函数“指针”吗?
答案 0 :(得分:2)