I am trying to refresh data in my excel sheet. The problem is I want to refresh it before i do anything else but it does not work that way- data is refreshed only AFTER script ends. For example:
ActiveWorkbook.Connections("Name").OLEDBConnection.CommandText = "SELECT * FROM ...(not important)"
ThisWorkbook.RefreshAll
REST OF THE SCRIPT WHICH USES ^ DATA
So the rest of my scipt always uses old data. When script it shows refreshed data but it looks like it only hapens AFTER everything.