0

Some background 1st solution: I have built an excel solution which imports the needed data using a from text data source. I had chosen this method as the URL which send the data will be sending a csv file. Once the data is received many process and conditions have to be applied on this.

Cause of concern: This takes a lot of time to get the data more than 6 mins. Which causes the excel to hang.

In my 2nd similar solution :- i had chosen to call a vb script from excel to do the downloading of data. This works very well for this solution. Now, i want to implement this method for 1st solution.

My main issue: The vb script used in the 2nd solution fails with the below error.

Error:- C:\Users-user id-\Desktop\script\download_moni.vbs(15, 1) msxml6.dll: The operation timed out

My code for VB Script:-

Set args = WScript.Arguments
Url = "url given here"
dim xHttp: Set xHttp = createobject("MSXML2.ServerXMLHTTP.6.0")
dim bStrm: Set bStrm = createobject("Adodb.Stream")
xHttp.Open "GET", Url, False 'Open socket to get the website
xHttp.Send 'send request
with bStrm
.type = 1 '//binary
.open
.write xHttp.responseBody
.savetofile "C:\Ticket\Monitoring.csv", 2 '//overwrite
end with
wscript.echo("Download complete")

Please let me know how to fix the timeout error.

4
  • VBScript IsNot VB.NET Commented Apr 28, 2016 at 16:25
  • I know that. But what do you mean? Commented Apr 29, 2016 at 10:29
  • That you had tagged with 'vb.net' although this has nothing to do with VB.NET. I removed that tag by the way. Commented Apr 29, 2016 at 13:33
  • Thanks for doing that. @Visual Vincent Commented Apr 30, 2016 at 3:53

1 Answer 1

1

You say that "[it] takes a lot of time to get the data more than 6 mins." Yet the default timeout of the library you are using seems to be 30 seconds for receiving data (source).

I am not familiar with the MSXML2.ServerXMLHTTP library you are using, but Google reveals that there is a setTimeouts method, which can be used to increase various timeouts of your library.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.