VBA Internet Explorer Unable to click "Export" Button.

CCL

New Member
Joined
Jan 15, 2021
Messages
1
Office Version
  1. 365
Platform
  1. Windows
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?

1610701839496.png


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!.
 

Some videos you may like

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

Watch MrExcel Video

Forum statistics

Threads
1,122,356
Messages
5,595,681
Members
414,009
Latest member
SNesbyCarr

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top