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: PropertiesThis second example returns a scheduled task and enables the user tochange the 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 SubSchedule PropertySyntaxCompletedJob.ScheduleApplies ToCompletedJobDescriptionReturns a reference to the parent Schedule object.DiscussionUse this property to access the parent Schedule object through theCompletedJob object.TypeObjectAccessRead<strong>Automate</strong> <strong>Scheduler</strong> <strong>Using</strong> <strong>Macros</strong> 123

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

Saved successfully!

Ooh no, something went wrong!