View Single Post
  #11   Report Post  
Posted to microsoft.public.excel.programming
John Bundy John Bundy is offline
external usenet poster
 
Posts: 772
Default ie Command to Wait for "File Download" and "Save As" windows

I did something similar in .net, i can't get it to set the newly created
window as the active one but this may get you that far//

Dim bBusy as Boolean at the top, then

Public Sub NavigateToUrlSync(ByVal url As String)

bBusy = True
wb.Navigate(url)
While (bBusy)
Application.DoEvents()
End While
End Sub

Private Sub wb_DocumentComplete(ByVal sender As Object, ByVal e As
AxSHDocVw.DWebBrowserEvents2_DocumentCompleteEvent ) Handles
wb.DocumentComplete
bBusy = False
End Sub

wb is the name of my webbrowser


--
-John
Please rate when your question is answered to help us and others know what
is helpful.


" wrote:

JP,

No Luck with "Do While ie.ReadyState < READYSTATE_COMPLETE" either.
Thanks so much for the help though. This is one of those daily tasks
that I'm looking to automate, so no hurry. I am happy to receive any
suggestions!

-Briana



On Jan 8, 5:54 pm, JP wrote:
Sorry, at this point I'm just fishing.

How about changing

Do Until ie.ReadyState = READYSTATE_COMPLETE

to

Do While ie.ReadyState < READYSTATE_COMPLETE

Kindly allow me some time to test your code and see if I can offer any
further suggestions.

Thx,
JP

On Jan 8, 8:09 pm, wrote:

I just tried Steve's code in place of my previous readystate commands
and unfortunately I get an error at Problems 2 and 3 at the line


Do While (ie.Busy)