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 macro to run and provides the catalog userclass and password, and the database user ID and password.Sub Main()Dim objSchedApp As ObjectDim objNewTask As ObjectSet objSchedApp = CreateObject("CognosBatcher.Application")'ensure that <strong>Scheduler</strong> has access to Impromtpu automationSet objNewTask = CreateObject("CognosBatcher.Schedule")With objNewTask.ScheduleDescription = "My macro task".ScheduleName = "C:\My<strong>Macros</strong>\ScheduleMacro.mac".ScheduleType = 0.RunAtHour = 18.RunAtMin = 45.EffectiveFrom = Date'This will store MyUserClass as the catalog user class.CatLogUsrCls = "MyUserClass"'This will store MyCatalogPassword as the catalog user'password, in encrypted form..CatLogUsrPw = "MyCatalogPassword"'This will store MyDatabaseID as the database user ID.DbUsrID = "MyDatabaseID"'This will store MyDatabasePassword as the database user'password, in encrypted form..DbUsrPW = "MyDatabasePassword".SaveEnd WithSet objNewTask = NothingSet objSchedApp = NothingEnd Sub<strong>Automate</strong> <strong>Scheduler</strong> <strong>Using</strong> <strong>Macros</strong> 57

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

Saved successfully!

Ooh no, something went wrong!