hi,
I need to refresh Query (PQ) after file saving.
Is there any way to check if is fully saved before executing next line?
In below code if any user would switch sheets very quickly I get run-time error.
I need to refresh Query (PQ) after file saving.
Is there any way to check if is fully saved before executing next line?
In below code if any user would switch sheets very quickly I get run-time error.
Code:
Private Sub Worksheet_Activate()
ActiveWorkbook.Save
ActiveWorkbook.Connections("Query - Total Query").Refresh
End Sub