carltheSwed
New Member
- Joined
- Feb 9, 2016
- Messages
- 2
Hi,
What i want the VBA code to achieve:
1. Go to a specific internet explorer site (this is already working)
2. When at this site press a button (export to excel) (here i am stuck/ where it crashes )
3. Save the excelfile in a folder
Via Chrome i have been able to look into the html code and i believe what i need to to is to run the javascript function stated bellow:
"""""
MY VBA CODE SO FAR (red is where i am stuck)
What i want the VBA code to achieve:
1. Go to a specific internet explorer site (this is already working)
2. When at this site press a button (export to excel) (here i am stuck/ where it crashes )
3. Save the excelfile in a folder
Via Chrome i have been able to look into the html code and i believe what i need to to is to run the javascript function stated bellow:
"""""
MY VBA CODE SO FAR (red is where i am stuck)
Code:
[/COLOR]Private Sub Populate_Click()
Dim i As Long
Dim IE As Object
Dim objElement As Object
Dim objCollection As Object
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.Navigate "webpage" 'make sure you've logged into the page
Do
DoEvents
Loop Until IE.READYSTATE = 3
[COLOR=#ff0000][B] IE.Document.parentWindow.execScript "dosubmitExcel();"[/B][/COLOR]
End Sub
[COLOR=#333333][Code]
Thanks a million![/COLOR]