Quote:
Originally Posted by lijon
You're missing a line in the bottom sub to actually call the gotowww sub.
Code:
Private Sub GotoMyWWW_Click()
Dim ans As String
Dim mysite As String
ans = InputBox("Doc ID?")
Set IE = CreateObject("InternetExplorer.Application")
With IE
.Visible = True
mysite = "http://www.yahoo.com/" & ans
.Navigate mysite
Do Until .ReadyState = 4: DoEvents: Loop
End With
End Sub
Private Sub CommandButton1_Click()
Call GotoMyWWW_Click '****add this!
End Sub
Cheers,
Lijon
|
Hi Lijon,
It actually works fine without that line, when adding that line it actually gives me error and highlights line starts with DO until.
Your code is perfect.. it was my fault for not assigning it as a macro to the button.
One last quick question:
if I dont type anything and click either ok or cancel it opens webpage with an error saying document not found.
How do I handle this error? can we prevent it from openning if no input has entered or clicked cancel.
Thanks