For some reason my code fails at this step:

Do While IE.document.readyState <> "complete"
What I'm trying to do is make sure the webpage loads completely before continuing. So the whole bit is:

Do While IE.document.readyState <> "complete"
     DoEvents
Loop
I get runtime error 438, Object doesn't support this property or method

The weird thing to me is, when I am stopped on this step because of the error, in the immediate window, when I query the property of ie.document.readystate (? IE.document.readystate), I get "complete" returned, so it's not like this is an inapplicable property of ie.document. I think that perhaps when the page is loading and is NOT complete, the error happens, then by the time I check in the immediate window, is IS complete, but that doesn't explain why I get this error when it's not complete.

I tried using "4" instead of "complete", and also using either or, but I keep getting the error when I get to this point and the page hasn't loaded.

here's where I dim and set stuff up at top of the module, in case that might be where there's a problem:

Dim IE As InternetExplorer
Set IE = New InternetExplorer
Does anyone know why i get this error, when the object clearly DOES support this method, since I can get "complete" returned in immediate window? Failing that, is there a better way to make sure an Internet Explorer page is completely loaded before continuing with code?

This also is not working:

Do While IE.Busy Or IE.readyState <> READYSTATE_COMPLETE Or IE.document.readyState <> "complete"
                                        DoEvents
                                    Loop

Thanks for any help