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 6: PropertiesExample 2This 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 SubRunAtMin PropertySyntaxObject.RunAtMinApplies ToOptionsScheduleDescriptionSets or returns• the default minute at which all new tasks run, for the Options object.• the minute at which the task runs, for a Schedule object.DiscussionUse this property in conjunction with RunAtHour property. The minutesare 0-59. For the Options object, use this property when the ExecuteAtproperty is set to specified time.TypeIntegerAccessRead/Write<strong>Automate</strong> <strong>Scheduler</strong> <strong>Using</strong> <strong>Macros</strong> 121

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

Saved successfully!

Ooh no, something went wrong!