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:
Could somebody please try and see if it works? and if not how to get around?
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