Hello All,
I am trying to get this code to work properly. As of now it functions as it should with one defect. When the export button is programatically clicked the new window that opens up closes before it finishes loading. Any assistance would be greatly appreciated. Here is the code I am currently using.
Sub ClickIE()
Dim ie As Object
Set ie = CreateObject("internetexplorer.application")
ie.Visible = True
apiShowWindow ie.Hwnd, SW_MAXIMIZE
ie.Navigate "intranet website"
While ie.Busy
DoEvents
Wend
Application.Wait (Now + TimeValue("0:00:4"))
ie.Document.getElementById("ReportViewerControl_ctl00_ctl03_txtValue").Value = Date - 1
ie.Document.getElementById("ReportViewerControl_ctl00_ctl07_txtValue").Value = Date - 1 & " 23:59"
ie.Document.all("ReportViewerControl$ctl00$ctl00").Click
Application.Wait (Now + TimeValue("0:00:4"))
ie.Document.getElementById("ReportViewerControl_ctl01_ctl05_ctl00").Value = "EXCEL"
ie.Document.all("ReportViewerControl_ctl01_ctl06_ctl00").Click
Application.Wait (Now + TimeValue("0:00:4"))
ie.Document.all("ReportViewerControl_ctl01_ctl05_ctl01").Click
End Sub
I am trying to get this code to work properly. As of now it functions as it should with one defect. When the export button is programatically clicked the new window that opens up closes before it finishes loading. Any assistance would be greatly appreciated. Here is the code I am currently using.
Sub ClickIE()
Dim ie As Object
Set ie = CreateObject("internetexplorer.application")
ie.Visible = True
apiShowWindow ie.Hwnd, SW_MAXIMIZE
ie.Navigate "intranet website"
While ie.Busy
DoEvents
Wend
Application.Wait (Now + TimeValue("0:00:4"))
ie.Document.getElementById("ReportViewerControl_ctl00_ctl03_txtValue").Value = Date - 1
ie.Document.getElementById("ReportViewerControl_ctl00_ctl07_txtValue").Value = Date - 1 & " 23:59"
ie.Document.all("ReportViewerControl$ctl00$ctl00").Click
Application.Wait (Now + TimeValue("0:00:4"))
ie.Document.getElementById("ReportViewerControl_ctl01_ctl05_ctl00").Value = "EXCEL"
ie.Document.all("ReportViewerControl_ctl01_ctl06_ctl00").Click
Application.Wait (Now + TimeValue("0:00:4"))
ie.Document.all("ReportViewerControl_ctl01_ctl05_ctl01").Click
End Sub