This code is not happening in the correct order.
I want to use the RefreshAll
function to pull the data, then calculate the worksheet and then apply the IF statement. Currently the calculation seems to happen lastly, so I have to run the code twice to get the desired result.
What do I need to do to force the correct order?
Public Sub version_control()
ThisWorkbook.RefreshAll
Worksheets("VC").Calculate
If Sheets("VC").Range("A1").Value <> Sheets("VC").Range("A2").Value Then
MsgBox "Please download the latest version from the Sharepoint"
Application.Quit
End If
End Sub