Automate Scheduler Using Macros
Automate Scheduler Using Macros
Automate Scheduler Using Macros
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Chapter 6: PropertiesExportAs PropertySyntaxSchedule.ExportAsApplies ToScheduleDescriptionSets or returns whether to export the report.DiscussionThis property is available only for Impromptu and PowerPlay reports. Thevalues for this property are• True - export the report• False - do not export the reportTypeBooleanAccessRead/WriteExampleThis example schedules a new task and exports the results to an Excelfile.Sub Main()Dim objSchedApp As ObjectDim objNewTask As ObjectSet objSchedApp = CreateObject("CognosBatcher.Application")Set objNewTask = CreateObject("CognosBatcher.Schedule")With objNewTask.ScheduleDescription = "My new exporting task".ScheduleName = "C:\Program Files\Cognos\Impromptu 5.0\" & _"Imp.5.0 Samples\Reports\Annual Product Sales.imr".ScheduleType = 0.RunAtHour = 13.RunAtMin = 20.EffectiveFrom = Date'export the results.ExportAs = True'export the results in Excel format.ExportType = "xls"'must supply a valid path and new file name.ExportFileName = "C:\MyExportFiles\ExcelExport.xls".SaveEnd WithSet objNewTask = NothingSet objSchedApp = NothingEnd Sub<strong>Automate</strong> <strong>Scheduler</strong> <strong>Using</strong> <strong>Macros</strong> 71