实时错误91,对象变量或with块变量未设置~~如何解决
Private Sub Command1_Click()
If Text1.Text = "" Then
MsgBox "请输入正确的网址", , "错误!"
Text1.SetFocus
Else
WebBrowser1.navigate Text1.Text
End If
End Sub
'Downloads By http://www.veryhuo.com
Private Sub WebBrowser1_DownloadComplete()
Text2 = WebBrowser1.Document.documentElement.outerHTML
End Sub
Private Function getHtmlStr$(strUrl$) '获取源码
Dim XmlHttp
Set XmlHttp = CreateObject("Microsoft.XMLHTTP")
XmlHttp.Open "GET", strUrl, True
XmlHttp.send
stime = Now
While XmlHttp.readyState <> 4
DoEvents
ntime = Now
If DateDiff("s", stime, ntime) > 3 Then getHtmlStr = "": Exit Function
Wend
getHtmlStr = StrConv(XmlHttp.responseBody, vbUnicode)
Set XmlHttp = Nothing
End Function
为什么直接运行可以 编译成执行程序就不行呢