Please help solve why IE.Document.all("nd-fsc-icn nd-fsc-icn16 nd-fsc-icn-FullScreen-B").click does not work

Joined
Nov 22, 2019
Messages
5
Office Version
  1. 2016
Platform
  1. Windows
Option Explicit

Sub ie_automated ()

Dim IE As InternetExplorer

Dim sURL As String

sURL = "goldprice.org/silver-price.html"
Set IE = New InternetExplorer

With IE

.Top = 373
.Left = 25
.Width = 1700
.Height = 600
.AddressBar = 0
.Toolbar = 0

.Visible = True
.Navigate sURL
'Application.Wait Now + TimeSerial(0, 0, 10)
Do Until Not .Busy And .ReadyState = 4
DoEvents
Loop


IE.Document.all("nd-fsc-icn nd-fsc-icn16 nd-fsc-icn-FullScreen-B").click


'nd-fsc-icn nd-fsc-icn16 nd-fsc-icn-FullScreen-B
'goldprice.org/silver-price.html
'IE.Document.all("nd-mnu-btn").Click

End With

Do Until Not IE.Busy
DoEvents
Loop

Set IE = Nothing
Err.Clear


End Sub
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

Domenic

MrExcel MVP
Joined
Mar 10, 2004
Messages
19,500
Try ...

VBA Code:
IE.Document.getElementsByClassName("nd-fsc-icn nd-fsc-icn16 nd-fsc-icn-FullScreen-B")(0).click

However, here's another way...

Code:
IE.Document.getElementByID("mnuTlb10").getElementsByTagName("button")(0).click

Hope this helps!
 
Joined
Nov 22, 2019
Messages
5
Office Version
  1. 2016
Platform
  1. Windows
Thanks for trying but neither option worked.

I still get the following run time error

1574554983740.png
 

Domenic

MrExcel MVP
Joined
Mar 10, 2004
Messages
19,500
It may be that there are multiple instances of Internet Explorer that persist. Try the following...

1) Make sure that you manually close any and all instance of Internet Explorer, if any are open.

2) Look at the processes in the Task Manager under Details, and see if there are one or more instances of iexplore.exe. If so, get rid of them by selecting each one, and then clicking on End Task for each of them. (Note that you can get to the Task Manager by pressing Ctrl+Alt+Del and selecting Task Manager.)

In addition, it may also be a good idea to explicitly quit Internet Explorer when finished. So you would add IE.Quit just before Set IE = Nothing .

Hope this helps!
 

Watch MrExcel Video

Forum statistics

Threads
1,129,577
Messages
5,637,190
Members
416,960
Latest member
Carbon1198

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