Click here to Skip to main content
15,897,166 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi guys,

i have 2 questions about refreshall method. it is said to be an asynchronous method which means that code moves to lines below, whereas in synchronous processes, code waits for the active task to finish and then goes on.

but sometimes, it seems that refreshall, too, behaves synchronous, just like in the code below. if it was asynhronous, as far as i know, "hi" message would come up immediatly after refresh, but it waits for the refresh is done.

VB
Private Sub Workbook_Open()

Me.RefreshAll

MsgBox "hi"

x = 0
Do
    x = x + 1
    MsgBox x
    '........
Loop

End Sub


2-what code should i write in the loop where "....." writes in order to check if the resfresh is done. there are some stuff for calculation issue like CalculationState, CalculateUntilAsyncQueriesDone but i wonder if there is any refresh equivalent. the code above runs forever as long as "refreshstate" bit is missing.



by the way, i know how to make code wait for all the refresh is done in other way, whicih is the usual one(for each connection, backgroundquery=false bla bla) but i want to do this in other way, the one above.
Posted
Comments
ZurdoDev 14-Oct-15 11:01am    
Just run the code and find out.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900