The download skips the rest of the macro.
Currently I have a subroutine I use to go onto a webpage and download a file. It opens up a bar that asks "Open, save, save as" I use send keys %O
to open the file. After the file opens I want to use another code to play around with the doc, problem is the file only opens after the rest of the macro is done. It for some reason just skips the rest of my macro essentially.
Here's an example of what I'm doing:
Sub iaspull()
Set ie = CreateObject("InternetExplorer.Application")
my_url = "***"
With ie
.Visible = True
.navigate my_url
Do Until Not ie.Busy And ie.readyState = 4
DoEvents
Loop
' Some code to get to the file and click download
End With
Application.Wait (Now + TimeValue("00:00:08"))
Application.SendKeys "%{O}", True
DoEvents
End Sub
Sub enable_edit()
Application.ActiveProtectedViewWindow.Edit
End Sub
Once the code gets to .SendKeys "%{O}"
it can do the open, but if there is more code after it then it will just skip the code.
I want to be able to run both of the subroutines one after the other. I would prefer not to save or use a save as function to keep this more universal.
Please let me know your thoughts!