pulsar777
08-02-2018, 10:05 AM
Hi,
my querytable refreshes its data from external source and then rest of the code is executed:
.ListObjects(1).QueryTable.Refresh BackgroundQuery:=False
' ... rest of the code
This way the rest of code waits until refresh is finished.
However I'd like to be able to cancel the refresh.
I tried with
BackgroundQuery:=True , this gave me option in statusbar to cancel it but rest of the code is run immediately without waiting.
Following:
Application.CalculateUntilAsyncQueriesDone let the rest of code wait but then I loose the option in statusbar to cancel.
Also I tried to launch a modeless form with button which onClick would execute
.ListObjects(1).QueryTable.CancelRefresh , but the form shows without button and inactive.
Can someone please advise ?
my querytable refreshes its data from external source and then rest of the code is executed:
.ListObjects(1).QueryTable.Refresh BackgroundQuery:=False
' ... rest of the code
This way the rest of code waits until refresh is finished.
However I'd like to be able to cancel the refresh.
I tried with
BackgroundQuery:=True , this gave me option in statusbar to cancel it but rest of the code is run immediately without waiting.
Following:
Application.CalculateUntilAsyncQueriesDone let the rest of code wait but then I loose the option in statusbar to cancel.
Also I tried to launch a modeless form with button which onClick would execute
.ListObjects(1).QueryTable.CancelRefresh , but the form shows without button and inactive.
Can someone please advise ?