I'm webserver try to get to the XML data to excel, so I have a The problem with web-server, can not connect or can not be found, is not giving excellent answer, it was terrible! To avoid this, I think that should set us time these are my function: usually happens when How to use the callback function when Msxml2 .ServerXMLHTTP.6.0 Is Request Timeout? Thank you for your help! line; There is no method assignment; But it gives immediate JavaScript according to your example links, provides the perfect way for a sendRequest
= sendRequest ("http://abb.com/index.php?id=111")
function sendRequest (URL) Call Set XMLHTTP = CreateObject ( "Msxml2.ServerXMLHTTP.6.0 ") are received 'the timeout value in seconds lResolve = 10 * 1000 lConnect = 10 * 1000 lSend = 10 * 1000 lReceive = 15 * 1000 callback function XMLHTTP.Open" gET "', lReceive XMLHTTP.OnTimeOut = OnTimeOutMessage server XMLHTTP. setTimeOuts lResolve, lConnect, waiting time to obtain data from lSend ', url, false error resume Next error XMLHTTP.Send Oto 0 sendRequest = (XMLHTTP.responseText) End Function Private Function OnTimeOutMessage () 'Application.Caller.Value = "Server Error: Request timed out" MsgBox ( "Server Error: Request time out") End Function
XMLHTTP end time, the event
OnTimeOutMessage will be executed (reference). But As such,
OnTimeOutMessage is performed at the beginning of the
sendRequest ()
XMLHTTP.OnTimeOut = OnTimeOutMessage
OnTimeOutMessage () performs (and its waste return value
function object invitation in the
Ontaimot after - it is not supported by VBA. < P> Instead, you can go to the trap after the timeout error has been raised or the initial binding,
after the
.seend Nts , & amp; inline event handlers.
Comments
Post a Comment