I\'m trying get xml data from webserver to excel, then I wrote a sendRequest
function to call in excel
=sendRequest(\"http://abb.com/index.php?id=
The line;
XMLHTTP.OnTimeOut = OnTimeOutMessage
Is not a method assignment; rather it immediately executes OnTimeOutMessage()
(and assigns its useless return value to OnTimeOut
).
The equivalent line in JavaScript as per your example link correctly assigns a Function
object to OnTimeOut
for subsequent invokation - this is not supported by VBA.
Instead, you could trap the timeout error raised after .send
or use early binding, WithEvents
, & inline event handlers.