markejackson02
New Member
- Joined
- Feb 1, 2011
- Messages
- 3
Two part question -
I am trying to download a file in XML format. The following code works on my machine at work, except it opens the annoying save dialog box. It does not work on my machine at home. Work is Win7 Pro with Office 2007. Home is Win7 Home Premium with Excel 2003.
The only difference are the references. At work, ieframe.dll points to the System32 directory while at home ieframe.dll points to the SysWow64 directory.
The problem is arising after I set the value for the first control. Updating it should cause the second control to change to an active control. As it is now, it is still in the initial state the does nothing. I have to manually click on the page to get it to update.
Is there any documentation for MS Internet Controls and HTML Object Library?
Thx
Mark Jackson
I am trying to download a file in XML format. The following code works on my machine at work, except it opens the annoying save dialog box. It does not work on my machine at home. Work is Win7 Pro with Office 2007. Home is Win7 Home Premium with Excel 2003.
The only difference are the references. At work, ieframe.dll points to the System32 directory while at home ieframe.dll points to the SysWow64 directory.
The problem is arising after I set the value for the first control. Updating it should cause the second control to change to an active control. As it is now, it is still in the initial state the does nothing. I have to manually click on the page to get it to update.
Is there any documentation for MS Internet Controls and HTML Object Library?
Thx
Mark Jackson
Code:
Sub LoadPage()
Dim szURL As String
Dim HTMLDoc As HTMLDocument
Dim oBrowser As InternetExplorer
Dim oHTML_Element As IHTMLElement
Dim r As Long
Dim ws As Worksheet
Dim v As Variant
Set ws = ThisWorkbook.Sheets(1)
szURL = "http://www.ngtsnavigates.com/ReportServer/Pages/ReportViewer.aspx?%2fInfoPost%2fNotices&rs%3aCommand=Render&assetNbr=51&CritFlag=0"
Set oBrowser = New InternetExplorer
oBrowser.Silent = True
oBrowser.navigate szURL
oBrowser.Visible = True
Do ' Wait till the Browser is loaded
Loop Until oBrowser.readyState = READYSTATE_COMPLETE
Set HTMLDoc = oBrowser.document
v = "ReportViewerControl_ctl01_ctl05_ctl00"
Set oHTML_Element = HTMLDoc.getElementById(v)
oHTML_Element.Value = "XML"
v = "ReportViewerControl_ctl01_ctl05_ctl01"
Set oHTML_Element = HTMLDoc.getElementById(v)
oHTML_Element.Click
oBrowser.Quit
End Sub