Hi Everyone,
I am trying to execute a Javascript in IE. here is my code.
Sub Excel_E()
Dim shellWins As ShellWindows
Dim objIE As InternetExplorer
Dim strScript As String
Set shellWins = New ShellWindows
If shellWins.Count > 0 Then
'Get IE
Set objIE = shellWins.Item(0)
strScript = "$find('ReportViewerControl').exportReport('EXCEL');"
objIE.document.parentWindow.execScript strScript, "JScript"
End If
End Sub
I am getting Run-Time error '438': Object Doesn't support this property or method at this line
objIE.document.parentWindow.execScript strScript, "JScript"
Am I missing something here. Please help
Bookmarks