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: PropertiesScheduleName PropertySyntaxSchedule.ScheduleNameApplies ToScheduleDescriptionSets or returns the path and file name of the report or other task to runfor a Schedule object.DiscussionUse this property to set or determine the path and name of the file runby a Schedule object. This property must be of non-zero length andmust specify a file known to the Windows file system. This propertycannot be changed once a schedule is saved. The maximum length ofthis property is 255 characters.TypeStringAccessRead/WriteExampleThis example schedules a new task to run every third day.Sub Main()Dim objSchedApp As ObjectDim objNewTask As ObjectSet objSchedApp = CreateObject("CognosBatcher.Application")Set objNewTask = CreateObject("CognosBatcher.Schedule")With objNewTask.ScheduleDescription = "My new task, every third day".ScheduleName = "C:\Program Files\Cognos\Impromptu 5.0\" & _"Imp.5.0 Samples\Reports\Annual Product Sales.imr"'set up daily execution.ScheduleType = 1'set up to run every third day.RecurCyc = 3.RunAtHour = 11.RunAtMin = 45.EffectiveFrom = Date.CatLogUsrCls = "Creator".SaveEnd WithSet objNewTask = NothingSet objSchedApp = NothingEnd Sub128 <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!