Simultaneous HTTP downloads from VBA
Simultaneous HTTP downloads from VBA
Simultaneous HTTP downloads from VBA
Simultaneous HTTP downloads from VBA
Simultaneous HTTP downloads from VBA
Simultaneous HTTP downloads from VBA Simultaneous HTTP downloads from VBA Simultaneous HTTP downloads from VBA Simultaneous HTTP downloads from VBA Simultaneous HTTP downloads from VBA Simultaneous HTTP downloads from VBA Simultaneous HTTP downloads from VBA Simultaneous HTTP downloads from VBA
Simultaneous HTTP downloads from VBA Simultaneous HTTP downloads from VBA
Simultaneous HTTP downloads from VBA
Go Back  Xtreme Visual Basic Talk > > > Simultaneous HTTP downloads from VBA


Reply
 
Thread Tools Display Modes
  #1  
Old 10-05-2013, 12:59 PM
Swannekin Swannekin is offline
Newcomer
 
Join Date: Oct 2013
Posts: 1
Default Simultaneous HTTP downloads from VBA


I am using Excel VBA to go out to many web sites, download the page source, and then do further processing. I use the following code to simply make an HTTP request, where "URL" is a variable to a URL address:
' Launch the HTTP httpRequest
On Error Resume Next
httpRequest.Open "GET", URL, False
If Err.Number <> 0 Then
' Handle connection errors
GetURLStatus = Err.Description
Err.Clear
Exit Function
End If
On Error GoTo 0


' Send the http httpRequest for server status
On Error Resume Next
httpRequest.Send
httpRequest.WaitForResponse
If Err.Number <> 0 Then
PageSource = "Error"
GetURLStatus = Err.Description
Err.Clear
Else
' Show HTTP response info
GetURLStatus = httpRequest.Status & " - " & httpRequest.StatusText
' Save the web page text
PageSource = httpRequest.ResponseText
End If

The problem is that is takes one to several seconds to process each request, and I have many URLs to process. What I would like to do is set up an Array and then call the above code simultaneously, with each call putting the PageSource (which is the Response Text) into an element of the array.

I don't know how to do this, or if it is even possible. I know it's possible using .NET but that's probably beyond my ability - I'd like to do this within the VBA environment.

Any ideas? Many thanks.
Reply With Quote
Reply

Tags
http, multi-threading, parallel, responsetext, web page


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Simultaneous HTTP downloads from VBA
Simultaneous HTTP downloads from VBA
Simultaneous HTTP downloads from VBA Simultaneous HTTP downloads from VBA
Simultaneous HTTP downloads from VBA
Simultaneous HTTP downloads from VBA
Simultaneous HTTP downloads from VBA Simultaneous HTTP downloads from VBA Simultaneous HTTP downloads from VBA Simultaneous HTTP downloads from VBA Simultaneous HTTP downloads from VBA Simultaneous HTTP downloads from VBA Simultaneous HTTP downloads from VBA
Simultaneous HTTP downloads from VBA
Simultaneous HTTP downloads from VBA
 
Simultaneous HTTP downloads from VBA
Simultaneous HTTP downloads from VBA
 
-->