Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Web Import Question

Status
Not open for further replies.

robcarr

Programmer
May 15, 2002
633
GB
Dear All,

I amusing the coding below to retrieve data from a web site, an inport into Excel, how can I tell when the data has finished importing, so I can retrieve another days worth of data.

The Coding.

Sub test()
Sheets(2).Select
pathname = [c3].Value
Sheets(1).Select
Range("a1").Select
Set shFirstQtr = Workbooks(1).Worksheets(1)
Set qtQtrResults = shFirstQtr.QueryTables _
.Add(Connection:=pathname, _
Destination:=shFirstQtr.Cells(1, 1).End(xlDown).Offset(1, 0))
With qtQtrResults
.WebSingleBlockTextImport = True
.Refresh
End With
Sheets(2).Select

End Sub

thanks for any help on this

Thanks Rob.[yoda]
 
I might be missing something here, but I don't think the code will finish the subroutine, until it's actually Refreshed, timed-out, or failed for some other reason.

In other words, I don't think it's spawning a new process and continuing on without waiting for the Refresh process to finish, but, as I said, I may be missing something.
 
The code works fine and gathers the data, the problem is it gathers the data using the get external data way and I have to wait for this to finish,(only way to tell is to check worksheet ot wait for globe to go on status bar) what I want to know is there any way to track when this is finished. so I can run another day.

Thanks

Thanks Rob.[yoda]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top