The capability of scripting across domain is affected by builtin security. Under "IE security settings" - "Miscellaneous", there are the options "Access data sources across domains" and "Navigate sub-frames across different domains".Dim pFramesCol As IHTMLFramesCollection2 ! Dim pDisp As Object Dim IWindow2 As IHTMLWindow2 Dim i As Integer ! Dim varIndex As Variant Dim frameDoc As IHTMLDocument2
Set pFramesCol = doc.frames
If Not pFramesCol Is Nothing Then
For i = 0 To pFramesCol.length - 1
varIndex = i
Set pDisp = pFramesCol.Item(varIndex)
! ' pDisp.QueryInterface IHTMLWindow2, IWindow2! Set IWindow2 = pDisp
If Not IWindow2 Is Nothing Then
If Not IWindow2.Document Is Nothing Then <== Possible error may arise: Access Denied
! Dim pDisp As Object
Dim IWindow2 As IHTMLWindow2
Dim i As Integer
! Dim varIndex As Variant
Dim frameDoc As IHTMLDocument2
Set pFramesCol = doc.frames
If Not pFramesCol Is Nothing Then
For i = 0 To pFramesCol.length - 1
varIndex = i
Set pDisp = pFramesCol.Item(varIndex)
! ' pDisp.QueryInterface IHTMLWindow2, IWindow2! Set IWindow2 = pDisp
If Not IWindow2 Is Nothing Then
If Not IWindow2.Document Is Nothing Then <== Possible error may arise: Access Denied
Set frameDoc = IWindow2.Document
End If
End If
Next i
End If
webrowser.document.frames.item(index).all(i)