I need to click a image button on web page which will download the report to excel. There is a javascript which does this, but I have no luck in executing the script, it says some error
Html:
a name="exportdlg" id="exportdlg" href="javascript:docCrystalEvent('doc', 'tb=exportdlg')" >img border=0 name="exportdlgImage" id="exportdlgImage" width=22.0px height=22.0px src='../../viewers/crystalreportviewers115/images/toolbar/export.gif' alt="Export this report" title="Export this report" ***********="this.src='../../viewers/crystalreportviewers115/images/toolbar/export_over.gif'"
VBA code:
objIEReportWindow.document.parentWindow.execScript "docCrystalEvent('doc', 'tb=exportdlg');"
here i m getting error 'Could not perform operation due to error 80020101'
another way i tried to access the image button is
For Each Element In objIEReportWindow.document.getElementsByTagName("a")
MsgBox (Element.innerText) 'to see if i get the required element
'If Element.Value = "Exportdlg" Then Element.click = True
Next
But still no luck yet, this is really getting into my nerves, as I've almost completed the entire automation but stuck here @ the end.
Any help would be highly appreciated...
Thanks in advance
Html:
a name="exportdlg" id="exportdlg" href="javascript:docCrystalEvent('doc', 'tb=exportdlg')" >img border=0 name="exportdlgImage" id="exportdlgImage" width=22.0px height=22.0px src='../../viewers/crystalreportviewers115/images/toolbar/export.gif' alt="Export this report" title="Export this report" ***********="this.src='../../viewers/crystalreportviewers115/images/toolbar/export_over.gif'"
VBA code:
objIEReportWindow.document.parentWindow.execScript "docCrystalEvent('doc', 'tb=exportdlg');"
here i m getting error 'Could not perform operation due to error 80020101'
another way i tried to access the image button is
For Each Element In objIEReportWindow.document.getElementsByTagName("a")
MsgBox (Element.innerText) 'to see if i get the required element
'If Element.Value = "Exportdlg" Then Element.click = True
Next
But still no luck yet, this is really getting into my nerves, as I've almost completed the entire automation but stuck here @ the end.
Any help would be highly appreciated...
Thanks in advance
Last edited: