HomeTek
New Member
- Joined
- Jan 27, 2017
- Messages
- 42
- Office Version
- 365
- Platform
- Windows
I have some code which does not seem to run in order. Specifically the "Test Value" line. Individually all parts of the code work fine, however the "Test Value" part always runs last no matter where it is placed.
The below code is an isolated simplified version of my code just for testing purposes.
I have turned off background refresh in the connections properties. I have also tried adding a "DoEvents" function after each line but to no avail.
Any more ideas at all please?
Thanks
The below code is an isolated simplified version of my code just for testing purposes.
I have turned off background refresh in the connections properties. I have also tried adding a "DoEvents" function after each line but to no avail.
Any more ideas at all please?
Thanks
VBA Code:
Sub Update Queries()
MsgBox ("Click okay to start."), vbOKOnly, "Test Box"
Application.ScreenUpdating = False
ActiveWorkbook.Connections("Raw Data 1").Refresh
Range("A1").Value = "Test Value"
MsgBox "Test message"
ActiveWorkbook.Connections("Raw Data 2").Refresh
End Sub