I am stuck in an issue accessing contentwindow of iframe using vba. The frames are in same domain when check using iframe.domain = document.domain. Below is what I have tried so far. I read all websites but couldn't find a way to get a workaround. Any other method for simplifying same domain/ cross domain messaging is highly appreciable.
Dim ie As New InternetExplorer
Dim objshell, objshellwindows
Dim doc As MSHTML.HTMLDocument
Dim doc1 As MSHTML.IHTMLDocument
Dim iframe As MSHTML.HTMLIFrame
Set objshell = CreateObject("Shell.Application")
Set objshellwindows = objshell.Windows
For Each ie In objshellwindows
If InStr(ie.LocationURL, "http://www.example.com/examples/camera/html/index.html") > 0 Then
Set doc = ie.document
For Each iframe In doc.getElementsByTagName("IFRAME")
Set doc1 = iframe.contentWindow.document '---Access Denied/ Permission Denied Error
Next
End If
Next