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: PropertiesCommandScript PropertySyntaxSchedule.CommandScriptApplies ToScheduleExampleSets or returns whether a command script runs while the scheduledreport is open.DiscussionThis property is valid only when the task type is Impromptu orPowerPlay. The values for this property are• True - the command script runs• False - the command script does not run.Set this property to True before providing the value forCommandFileName.TypeBooleanAccessRead/WriteExampleThis example schedules a new report and indicates that an application isrun while the report is open.Sub Main()Dim objSchedApp As ObjectDim objNewTask As ObjectSet objSchedApp = CreateObject("CognosBatcher.Application")Set objNewTask = CreateObject("CognosBatcher.Schedule")With objNewTask.scheduletype=0.ScheduleDescription = "My CommandScript task".ScheduleName = "c:\program files\cognos\impromptu 5.0\" & _"imp.5.0 samples\reports\annual product sales.imr".RunAtHour = 18.RunAtMin = 45'run a command script every time this task is executedCommandScript=True.CommandFileName = "C:\MyProgramPath\MyProgram.exe".SaveEnd WithSet objNewTask = NothingSet objSchedApp = NothingEnd Sub<strong>Automate</strong> <strong>Scheduler</strong> <strong>Using</strong> <strong>Macros</strong> 49

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

Saved successfully!

Ooh no, something went wrong!