Automate Scheduler Using Macros
Automate Scheduler Using Macros
Automate Scheduler Using Macros
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Chapter 6: PropertiesCount PropertySyntaxcollection.CountApplies ToCompletedJobsSchedulesDescriptionReturns the number of items in the CompletedJobs or Schedulescollection.DiscussionUse this property to obtain the number of items in the Schedulescollection. The valid range for this property is greater than or equal tozero. (>= 0)TypeLongAccessReadExampleThis example displays the number of tasks in both the Completed andthe Schedules collection.Sub Main()Dim objSchedApp As ObjectDim objSchedules As ObjectDim objCompletedTasks As ObjectDim intNumberComplete As IntegerDim intNumberSchedules As IntegerSet objSchedApp = CreateObject("CognosBatcher.Application")Set objCompletedTasks = objSchedApp.CompletedSet objSchedules = objSchedApp.Schedules'get the number of tasks in the Completed collectionintNumberComplete = objCompletedTasks.CountMsgbox "There are " & Str(intNumberComplete) & _"tasks in the completed collection."'get the number of tasks in the Schedules collectionintNumberSchedules = objSchedules.CountMsgbox "There are " & Str(intNumberSchedules) & _"tasks in the schedules collection."Set objSchedules = NothingSet objCompletedTasks = NothingSet objSchedApp = NothingEnd Sub<strong>Automate</strong> <strong>Scheduler</strong> <strong>Using</strong> <strong>Macros</strong> 53