Hi,
I am trying to click the export button by ID ("exportRpt") but nothing happen in the IE. Is there anything that I have missed?
I have written a code to loop through each IE and find the new IE that I am going to work with.
here is my Macro code:
Sub Third_Level()
Dim TWB As Workbook
Set TWB = ThisWorkbook
Dim target As String
Dim IE As InternetExplorer
target = "URL (Deleted Due to confidentiality")
Set objshell = CreateObject("Shell.Application")
IE_Count = objshell.Windows.Count
For x = 0 To (IE_Count - 1)
On Error Resume Next ' sometimes more web pages are counted than are open
My_url = objshell.Windows(x).LocationURL
My_Title = objshell.Windows(x).document.Title
If My_url = target Then 'compare to find if the desired web page is already open
Set IE = objshell.Windows(x)
Exit For
End If
Next
Dim DOC As HTMLDocument
Set DOC = IE.document
Dim IDTAG3 As IHTMLElement
Set IDTAG3 = DOC.getElementById("exportRpt")
IDTAG3.Click
End Sub
Thank in advance!.
I am trying to click the export button by ID ("exportRpt") but nothing happen in the IE. Is there anything that I have missed?
I have written a code to loop through each IE and find the new IE that I am going to work with.
here is my Macro code:
Sub Third_Level()
Dim TWB As Workbook
Set TWB = ThisWorkbook
Dim target As String
Dim IE As InternetExplorer
target = "URL (Deleted Due to confidentiality")
Set objshell = CreateObject("Shell.Application")
IE_Count = objshell.Windows.Count
For x = 0 To (IE_Count - 1)
On Error Resume Next ' sometimes more web pages are counted than are open
My_url = objshell.Windows(x).LocationURL
My_Title = objshell.Windows(x).document.Title
If My_url = target Then 'compare to find if the desired web page is already open
Set IE = objshell.Windows(x)
Exit For
End If
Next
Dim DOC As HTMLDocument
Set DOC = IE.document
Dim IDTAG3 As IHTMLElement
Set IDTAG3 = DOC.getElementById("exportRpt")
IDTAG3.Click
End Sub
Thank in advance!.