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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MACRO : Improptu report to Excel 1

Status
Not open for further replies.

JackONeill

Programmer
Mar 8, 2004
65
US
Hello,

Is it possible to run a macro that open an impromptu report and save it as an excel File?

cya
 
Here's what I used in the macro for that:

'Open Impromptu
Set objApp = CreateObject("CognosImpromptu.Application")
trueName = path & fileName & ".imr"
Set objRep = objApp.OpenReport(trueName)
strExcelFileName = path & fileName
'Save As Excel
objRep.ExportExcel strExcelFileName & ".xls"
objRep.CloseReport
objApp.Quit
Set objApp = Nothing
Set objRep = Nothing

Couple of warnings:
* This is for 7.1!
* make a variable "path" and "filename" and give them the appropriate values
* there is a difference when you save it WITH format. See the CognosScript Editor Help for that.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top