I'm having problems with Opening a worksheet while VBA is running (as Excel/VBA is occupied, it prevents another sheet opening as far as I'm aware).
SendKeys ("%O")
Application.Wait DateAdd("s", 1, Now)
'Loop that waits for file to open
Dim TestWorkbook As Workbook
Set TestWorkbook = Nothing
On Error Resume Next
Set TestWorkbook = Workbooks("export.csv")
OpenLoop:
If TestWorkbook Is Nothing Then
Application.Wait DateAdd("s", 1, Now)
GoTo OpenLoop
Else
End If
'Loop that waits for file to open (End)
Workbooks("export.csv").Activate
SendKeys ("%O")
is used to open the file on Internet Explorer as below:
If the code ended here, it will open successfully as VBA has finished. Now, it just get stuck in the loop because VBA being busy is preventing the file to open.
Problem: I need a solution to allow the file to open so the VBA can continue and work on the downloaded folder.
Any help will be appreciated, thank you in advanced.