11.07.2015 Views

Automate Scheduler Using Macros

Automate Scheduler Using Macros

Automate Scheduler Using Macros

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 5: MethodsExampleThis example returns a scheduled task and enables the user to changethe execution time to midnight.Sub Main()Dim objSchedApp As ObjectDim obj<strong>Scheduler</strong>Tasks As ObjectDim objSpecificTask As ObjectSet objSchedApp = CreateObject("CognosBatcher.Application")Set obj<strong>Scheduler</strong>Tasks = objSchedApp.SchedulesSet objSpecificTask = obj<strong>Scheduler</strong>Tasks.Item(1)'the Edit method allows modification of this taskobjSpecificTask.Edit'RunAtHour and RunAtMin hold integers representing the hour'(in 24 hour format) and minute of scheduled execution.objSpecificTask.RunAtHour = 3objSpecificTask.RunAtMin = 33'the Save method will apply any modifications made to the'task since the invocation of the Edit methodobjSpecificTask.SaveSet objSpecificTask = NothingSet obj<strong>Scheduler</strong>Tasks = NothingSet objSchedApp = NothingEnd SubSendResults MethodSyntaxCompletedJob.SendResults [FileName]Applies ToCompletedJobDescriptionSends the results by• activating mail and attaching the file to the message for a local taskthat includes options such as save as snapshot or save as external fileformat.• exporting a document to the specified location enabling other usersto view the results for a remote task involving results that completedsuccessfully.36 <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!