Making WebBrowser app work with all IE versions
I don't know how to do this with the webbrowser control, but I think I do
know how to do this with IE instances. You may be able to make this work for
the WebBrowser control as well...
Add this code to an form with a command button:
Private Declare Function InternetExplorer Lib "shdocvw.dll" () As Object
Private Sub Command1_Click()
Dim IE
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.Navigate "http://www.wanadoo.nl/"
End Sub
As it requires no references to shdocvw.dll, I guess it doesn't check
version either.
--
Stephan van Erp
ICQ #49819760
http://vbpoint.cjb.net/
Quote:
> How do I write a VB application that uses the WebBrowser control that will
> work with different versions of IE? The CLSID seems to change for
different
> versions (for instance, IE 4.0 vs. IE 5.5) which breaks VB apps that have
> references to the WebBrowser control (shdocvw).
> I've written a basic application that has a WebBrowser control hosted on a
> form. It was written on a box with IE 5.50.4522.1800 (the version of
> shdocvw.dll is 5.50.4614). In the auto-generated code for the form, the
> following is listed:
> Object = "{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}#1.1#0"; "shdocvw.dll"
> If I run this application on a computer with an older version of IE
> (5.00.3103.1000) and shdocvw.dll (5.0.3103), then the application fails
> with:
> "Error 429: ActiveX component can't create object"
> It looks like the CLSID for the webbrowser control on that machine is
> EAB223C0-30C1-11CF-A7EB-0000C05BAE0B (there's a 3 in the 6th position
> instead of an A).
> Is it possible to write an application that will work with any version of
IE
> from 4.0 up, assuming that I'm using methods and events that were
available
> from 4.0 on? Making them upgrade to version of IE that I use for
> development is not an option...
> Thanks for any ideas!
> Mike