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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error opening Internet Explorer 1

Status
Not open for further replies.

barrylowe

Programmer
Nov 6, 2001
188
GB
I have created a little app which sits at the bottom of the users screen and scrolls a series of little labels across the screen. The labels' tag property contains a URL and when one of the labels is clicked it opens an instance of Internet Explorer at the relevant URL.

This works fine the first time I do it, but the second time I get the following error:

"Method 'web' of object 'Form1' failed"

The code for the click event is as follows:


Private Sub lblLinks_Click(Index As Integer)

Set web = New SHDocVw.InternetExplorer
web.Visible = True
web.Navigate lblLinks(Index).Tag

End Sub

The following line also appears in the declarations section:

Public WithEvents web As SHDocVw.InternetExplorer


Can anyone help?
 
Can you just use a shell command to open an external instance of ie:
Shell ("c:\program files\internet explorer\iexplore www.[site name]"), vbMaximizedFocus
 
Hi Barry,

After:
Set web = New SHDocVw.InternetExplorer
web.Visible = True
web.Navigate lblLinks(Index).Tag

Include:
Set web= Nothing

Then u will not have that error.

Regards,
Baby
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top