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: PropertiesExampleThis example schedules a new task to be run on a monthly basis usingordinal dates (the first Monday of every month) during the period fromMarch 15 to June 12, 1998.Sub Main()Dim objSchedApp As ObjectDim objNewTask As ObjectSet objSchedApp = CreateObject("CognosBatcher.Application")Set objNewTask = CreateObject("CognosBatcher.Schedule")With objNewTask.ScheduleDescription = "My new task, runs on the first " & _"Monday of every month".ScheduleName = "C:\Program Files\Cognos\Impromptu 5.0\" & _"Imp.5.0 Samples\Reports\Annual Product Sales.imr"'set up monthly execution, ordinal day.ScheduleType = 4'set up to run every month.RecurCyc = 1'set up to run on the first (OrdinalDay = 1)'Monday (RecurDayOfWk = Hex 2) of the month.RecurDayOfWk = &H02.OrdinalDay = 1'set up this task to only be considered for execution between'March 15, 1998 and June 12, 1998.EffectiveFrom = #3/15/1998#.UntilDate = #6/12/1998#.RunAtHour = 18.RunAtMin = 45.SaveEnd WithSet objNewTask = NothingSet objSchedApp = NothingEnd Sub<strong>Automate</strong> <strong>Scheduler</strong> <strong>Using</strong> <strong>Macros</strong> 61

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

Saved successfully!

Ooh no, something went wrong!