Private Sub WebBrowser1_NewWindow2(ppDisp As Object, Cancel As Boolean)
Dim frm As New userform1
Dim strUrl As String
Dim htmldoc As HTMLDocument
Set htmldoc = WebBrowser1.Document
frm.WebBrowser1.RegisterAsBrowser = True
Set ppDisp = frm.WebBrowser1.Object
frm.Show
End Sub
Quote:
Dim frm As New userform1
Dim htmldoc As HTMLDocument
|
look at these two things you declare
frm is a type of userform1, i suspect this is the person who code this self make, you might need a class module which name is userform1, where you got this code from? This is probably why you got object not declare error
htmldoc i think you might solve the problem already which it need to include a reference Microsoft HTML Object Library