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 demonstrates the use of the IgnoreServerTasks andIgnoredSince properties of the Options object.Sub Main()Dim objSchedApp As ObjectDim objOptions As ObjectDim intResponse As IntegerSet objSchedApp = CreateObject("Cognosbatcher.Application")Set objOptions = objSchedApp.OptionsWith objOptions'IgnoreServerTasks is Boolean indicates if <strong>Scheduler</strong> is'configured to run locally onlyIf .IgnoreServerTasks Then'IgnoredSince is a read only property that indicates the'last time IgnoreServerTasks was set to TRUEintResponse = MsgBox("<strong>Scheduler</strong> has been configured to "&_"run locally since " & .IgnoredSince & _". Would you like to switch to run using the server? " & _"(NOTE: If you do not have the connector option " & _"installed, <strong>Scheduler</strong> will always be set to run " & _"locally.)",259,"Run Locally")If intResponse = 6 Then.IgnoreServerTasks = False.SaveEnd IfElseintResponse = MsgBox("<strong>Scheduler</strong> has been configured to " & _"run using the server. Would you like to switch to " & _"run locally?",259,"Run on the Server")If intResponse = 6 Then.IgnoreServerTasks = True.SaveEnd IfEnd IfEnd WithSet objOptions = NothingSet objSchedApp = NothingEnd Sub<strong>Automate</strong> <strong>Scheduler</strong> <strong>Using</strong> <strong>Macros</strong> 83

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

Saved successfully!

Ooh no, something went wrong!