Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Impromptu: how to overcome read-only msgbox in a macro

Status
Not open for further replies.

saira78

Technical User
Jan 14, 2003
40
CA
I'm running a macro to export a report to an .xls file using the Windows scheduler utility.

If the report is read-only, the macro will not finish execution. How can I send a signal in the macro to overcome the read-only message box?

I read the manual about SendKeys "{ENTER}" but it does not seem to work. Perhaps I have not put it in the right place in the script? Thanks in advance for your help.

Set objImpApp = CreateObject("CognosImpromptu.Application")
objImpApp.Visible 1
objImpApp.OpenCatalog _
strPath & "\eis_order_summary.cat","Creator",,"db","passwd"
Set objImpRep = _
objImpApp.OpenReport(strPath & "\mac_hospital_order_summary_v2.imr","2")
>> SendKeys "{ENTER}"
strExcelFileName = strFileDir & "\MSH_order_summary_"
objImpRep.ExportExcel strExcelFileName & yesterday & ".xls"
objImpRep.CloseReport
Set objImpRep = Nothing


Saira
 
Ok. I just answered my own question. SendKeys is before setting the objImpApp statement.

SendKeys "{ENTER}"
Set objImpRep = _
objImpApp.OpenReport(strPath & \mac_hospital_order_summary_v2.imr","2")

And the report runs!

Thanks
Saira
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top