i search for a method to click to a link in an iframe in VBA code
what i still done:
Set IEApp = GetObject(\"new:{D5E8041D-920F-45e9-B8FB-B1DEB82C6E5E}\"
Try using a CSS selector to target the element within the iframe.
If you think it is a timing problem you can
1) loop while target element is nothing i.e. not set; with timeout to avoid potential for infinite loop
Dim t As Date, ele As Object, waitTime As Long
t = Timer
waitTime = 10 '<== secs
Do
DoEvents
On Error Resume Next
Set ele = IEDocument.frames("IFRAME").document.querySelector("a[href=javascript:choose('Objektnummer, Referenznummer')]")
On Error GoTo 0
If Timer - t = waitTime Then Exit Do '<==To avoid infinite loop
Loop While ele Is Nothing
Call IEDocument.iframe.execScript("Choose('Objektnummer,Referenznummer')", "JavaScript")
2) Set an explicit wait
Application.Wait Now + TimeSerial(0,0,5) '<== adjust 5 which is number of seconds
Call IEDocument.iframe.execScript("Choose('Objektnummer,Referenznummer')", "JavaScript")