我在程序里引入webbrowser控件。代码形式如下(简化)
webbrowser.document.open
webbrowser.document.writeln "<html><body>"
webbrowser.document.writeln "测试</body></html>"
webbrowser.document.close
在我的机器上运行可以通过。问我打包后安装在别的机器上就显示 “91”错误,那位告诉可以给我一个解决问题的办法,小弟立即给分!

解决方案 »

  1.   

    WebBrowser.Navigate "about:blank"
        While (WebBrowser.Busy)
        Wend
        WebBrowser.Document.open
        WebBrowser.Document.writeln "<html><body>"
        WebBrowser.Document.writeln "测试</body></html>"
        WebBrowser.Document.Close
      

  2.   

    WebBrowser.Navigate "about:blank"
        While (WebBrowser.Busy)
        Wend
        WebBrowser.Document.open
        WebBrowser.Document.writeln "<html><body>"
        WebBrowser.Document.writeln "测试</body></html>"
        WebBrowser.Document.Close
      

  3.   

    我的机器是XP,IE6.0SP1的,WebBrowser1.Navigate "about:blank"
    WebBrowser1.Document.open
    WebBrowser1.Document.writeln "<html><body>"
    WebBrowser1.Document.writeln "测试</body></html>"
    WebBrowser1.Document.Close
    可以成功
      

  4.   

    为什么一定要用writeln方法呢?
    写个htm文件,用时再加载不行吗?
    或都把htm代码写在字符串中,用时再写出个文件,再加载。这样也可以达到目的呀。
      

  5.   

    WebBrowser1.Navigate "about:blank"Dim i As Double
    Dim j As Double
    Dim i1 As Double    For i = 1 To 2                   '增加一个延时,可以解决
        DoEvents
            For j = 1 To 10000
                i1 = j * 321
                i1 = i1 / 234
        Next j, i
        
        WebBrowser1.Document.open
        WebBrowser1.Document.write "<html><body>"
        WebBrowser1.Document.write "测试</body></html>"
        WebBrowser1.Document.Close