Problem: Workbook won't open until the code has finished running.
Details: I have a loop that required the user to have another file open, in order for the code to continue. This file has to be downloaded from the internet and opened. If the file isn't open a msgbox appears asking the user to open the file. Even though I download the file and open it, it wont open until all of the other code has been executed.
My Thoughts: Maybe there is something like a "Refresh", that updates the current state. I should probably add something to the existing code below that refreshes the excel workbooks and sees if something else has happened.
Code below: (The code is fine and works for what I need, the problem is that the workbook won't open until all the other code is complete):
Private Function WorkbookActive() As Boolean ' Loop until the correct workbook is open Do Until WorkbookActive = True On Error Resume Next If Workbooks("Rapport.csv") Is Nothing Then If MsgBox("[Rapport.csv] - Workbook is currently not open." & vbNewLine & "Please download and open [Rapports.csv] and press OK", vbOKCancel, "Workbook not open") = vbCancel Then Exit Do WorkbookActive = False ElseIf Not Workbooks("Rapport.csv") Is Nothing Then WorkbookActive = True End If Loop End Function