Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Webbrowser and DoEvents Reference Error

Status
Not open for further replies.

mbro

Programmer
Nov 12, 2004
25
0
0
US
Hi,

Up until last week I had code that worked quite simply to navigate in a webrowser control to a website and take a screenshot of that website. Suddenly however the code has stopped working. The first error I received was that the webbrowser1.navigate member was not found despite the Internet Controls reference being checked. That I solved by changing from the ieframe reference to the shdocvw reference. When I ran my code again the website did load but I then received an automation error at Do Events. Could someone help solve either of the two problems for me, I've tried wiping vb off my machine and reloading without any luck. I've shown my code below.

WebBrowser1.Navigate "
Do
DoEvents
Loop Until WebBrowser1.Busy = False

SaveScreen "C:\yahoo.bmp"

Thanks,
Mike
 
No problem here with your code* on XPpro and IE7. I have Yahoo with the animated penguin!

*with 'SaveScreen "C:\yahoo.bmp"' excluded

Hugh
 
Test done using an on form Webrowser control selected from Project menu - Components option - Components dialog - Microsoft Internet Controls(...ieframe.dll)

shdocvw (.dll?) is not shown for any controls I have listed in the Components dialog.

Are you referencing the Webbrowser control from Project menu - Components and using an on form Browser control or via Project menu - References and using automation?

regards Hugh
 
Ok now I have done the test by selecting shdocvw.dll manually via browse from Project menu - Components and yes I do have the same error as you. The Web page displays ok but then I get 'Automation error' on the Doevents.

I can only say that it seems ieframe.dll is probably the prefered component because it is listed in the Components dialog; and leave it open to others..... if I have time I'll give it a go on IE6 tomorrow.

Sorry I can't be of more help.

Regards Hugh


 
Hi,

Thanks for the input. I'd prefer to stay with the ieframe.dll but then my webbrowser.navigate component fails. I upgraded Internet Explorer about two weeks ago and thought it had worked since that time... There must be something regarding IE7 that is affecting it. If anyone has any suggestions I'd more then appreciate it.

Cheers,
Mike
 
Mike,

Have just run the test on a host system with IE6 and I get no error (using the shdocvb.dll WebBrowser control) so I guess it looks like an IE7 issue with shdocvb.dll.

Hugh
 
re my IE7 test reported in my post at 17 Dec 06 17:54 the Automation error does not occurr when the project is compiled only in the IDE.
 
shdocvw.dll can generally be found as "Microsoft Internet Controls" in the VB IDE reference list.
 
Thanks everyone for the help. The problem is sorted now.

Cheers,
Mike
 
Mike,
With respect it would be good if you can document your solution (links) so that others in this forum can benefit from your experience.
regards Hugh,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top