PDA

View Full Version : Solved: ie automation... browser control. JVM error not loaded?



champagne_ch
06-02-2013, 11:34 AM
Hello,

Hoping somebody here can help with this one.. it is more specific an can be tested..

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/4unly4jzxm01j1u/2012-10-03%2012-15securedoc%20-%20Copy.html

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


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?

champagne_ch
06-02-2013, 03:24 PM
Fixed.. Issue = compatibility of webbrowser component by default is ie7.

Registry fix : Discussed here (http://msdn.microsoft.com/en-us/library/ee330730(v=vs.85).aspx)