Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21845

[RESOLVED] browser control. JVM error not loaded?

$
0
0
Hello,

Hoping somebody here can help.

I have been trying to use mshtml in vba to scrape data from a webpage but with major stability issues. I then tried with vb6 but still stability issues.

I therefore decided to try using a webcontrol and see whether it was more stable.. however i am not even able to load the page properly.

the link for the html is as follows: https://www.dropbox.com/s/4unly4jzxm...0-%20Copy.html

The code behind then form is as follows.. the only thing the form contains is the browser control:

Code:

  Dim WithEvents Web_V1 As WebBrowser_V1
                       

                       
      Private Sub Web_V1_NewWindow(ByVal URL As String, _
                                  ByVal Flags As Long, _
                                  ByVal TargetFrameName As String, _
                                  PostData As Variant, _
                                  ByVal Headers As String, _
                                  Processed As Boolean)
        Processed = True
        MsgBox URL
        WebBrowser1.navigate URL
       
      End Sub
       

Private Sub Form_Load()

    Dim UrlDir As String
    UrlDir = "http://127.0.0.1/bankstats/encrypted/"
   
        Dim URL As String
    Dim FileName As String
        Dim DecryptedFilePath As String
        FileName = "2012-10-03 12-15securedoc.html"
140            localFilePath = localDir & "\" & FileName

150    DecryptedFilePath = DecryptedDir & "\" & FileName

URL = UrlDir & "\" & FileName
'URL = "http://whatsmyuseragent.com/"
'URL = "www.netdania.com"
URL = "D:\Documents\work\FilesToImport\BankStats\encrypted\" & FileName
          Dim htmlDoc As MSHTML.HTMLDocument    ' html object lib
          Dim htmlInput As MSHTML.HTMLInputElement
          Dim htmlDiv As MSHTML.HTMLDivElement
          Dim htmlColl As MSHTML.IHTMLElementCollection
          Dim StartTime As Date
          Dim msg As String

      Set Web_V1 = WebBrowser1.Object
      WebBrowser1.Navigate2 URL
End Sub

Could somebody please try and see if it works? and if not how to get around?

Viewing all articles
Browse latest Browse all 21845

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>