Hello all,
On an exchange, I'm trying to find some information about a delisted instrument based on its ISIN code. The exchange use an iframe, so I have to find a way to go to the right tab with the information.
My code is:
When the URL loads, it goes to a tab called Quotes, but I want to go to the next tab called Delisted Instruments. My code finds the tab (at least where the innertext does match), but I'm not able to find the 'A' element so I can click on it?
Anyone who knows how I can move to the right tab? @John_w maybe?
On an exchange, I'm trying to find some information about a delisted instrument based on its ISIN code. The exchange use an iframe, so I have to find a way to go to the right tab with the information.
My code is:
VBA Code:
Sub FindDelisted()
Dim IE As InternetExplorer, HTMLdoc As HTMLDocument, Ifrm As HTMLIFrame, HTMLbtn As Object
Dim i As Long
Set IE = New InternetExplorer
With IE
.Visible = True
.navigate "http://mdweb.ngm.se/MDWebFront/quotes.html?locale=en_us&activeTab=ndxQuotes&search=DE000SD340R0"
While .Busy Or .readyState <> READYSTATE_COMPLETE: DoEvents: Wend
Set HTMLdoc = .document
End With
Do While Ifrm Is Nothing
Set Ifrm = HTMLdoc.getElementById("quotesDiv")
DoEvents
Loop
With Ifrm.all
Do While .Length = 0
DoEvents
Loop
For i = 0 To .Length - 1
'Find the 'item' that is equal to 'Delisted Instruments'
With .Item(i)
If .innerText = "Delisted Instruments" Then
'Click the 'A' element
Set HTMLbtn = .getElementsByTagName("A")(0)
If Not HTMLbtn Is Nothing Then
HTMLbtn.Click
Exit For
End If
End If
End With
Next i
End With
End Sub
Anyone who knows how I can move to the right tab? @John_w maybe?