11.07.2015 Views

Automate Scheduler Using Macros

Automate Scheduler Using Macros

Automate Scheduler Using Macros

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 6: PropertiesExportFileName PropertySyntaxSchedule.ExportFileNameApplies ToScheduleDescriptionSets or returns the path and the name of the file created from the resultsof the Schedule object.DiscussionUse this property to set or determine the name of the exported file. Thisproperty is valid only when ExportAs is True. The maximum length ofthis property is 255 characters.TypeStringAccessRead/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 Sub72 <strong>Automate</strong> <strong>Scheduler</strong> <strong>Using</strong> <strong>Macros</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!