Progressbar on userform for waiting querytable retrieving data from web

  • Thread starter auctiontitlebuilder
  • Start date
A

auctiontitlebuilder

Dear all,
i'm getting crazy to understand how to show progress of querytables
retrieving data from website.
I tried userform show but it seems by this method i stop query working
What I want to do is to show a progress bar on userform to count how
many time do i need to wait till data retrieving from website by
querytable

many thanks for your precious help

bye
 
N

NickHK

You say "query tables" (plural), so may be this.
Depends what/how you are doing your progress bar.


Private Sub CommandButton1_Click()
Dim WS As Worksheet
Dim QTCount As Long
Dim QT As QueryTable

For Each WS In ThisWorkbook.Worksheets
QTCount = QTCount + WS.QueryTables.Count
'Set the Max value of the progress bar
Debug.Print "Queries in WB: " & QTCount
Next

QTCount = 0

For Each WS In ThisWorkbook.Worksheets
For Each QT In WS.QueryTables
QT.Refresh False
QTCount = QTCount + 1
'Update the progress bar
Debug.Print "Queries processed: " & QTCount
Next
Next

End Sub

NickHK
 
A

auctiontitlebuilder

I have for example the following part of code:

With ActiveSheet.QueryTables.Add(Connection:="URL;http://
www.amazon.com/s/ref=nb_ss_gw/105-8148871-0525223?url=search-alias%3Daps&field-keywords="
& chiave & "&Go.x=10&Go.y=11", Destination:=Range("A1"))
.Name = "?"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlOverwriteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlEntirePage
.WebFormatting = xlNone
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.Refresh BackgroundQuery:=False
End With

so NickHK where can i fill your code to progress query time working???

thanks a lot
 
N

NickHK

If it is just this one querytable, then you cannot, because as Tom pointed
out, the refresh is a single action and you get no feed back.

NickHK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top