I'm having a problem with hung processes if the Task Scheduler times out. I run all of our Business Objects reports with Windows Task Scheduler. If the VBScript encounters a problem (like with the printing command - objDoc.PrintOut) the script hangs at this command and will not proceed and the Windows Task will eventually time out without quitting/stopping the busobj.exe process. Then the next BO report will not run via the Task Scheduler because of the already running busobj.exe process. How can I incorporate some type of timeout code to close the application (busobj.exe) if the script hangs before the appint.Quit command is reached? Below is the code I'm using
Thanks,
HW
'***********************
'Runs List for all departments
'***********************
dim appint
dim strFile
dim vars
dim objDoc
dim objRpt
Set appint = CreateObject("BusinessObjects.Application")
Set objMail = CreateObject("Persits.MailSender")
Set vars = appint.Variables
appint.Interactive = False
appint.Visible = True
'******************************
'Connect to Business Objects
'prints List report
'******************************
With appint
.LoginAs "username","password"
strReportName = "List"
Set objDoc = appint.Documents.Open(strReportName)
vars.Item("dept").value = "A"
objDoc.Refresh
objDoc.PrintOut("PRINTER")
objDoc.Close
End With
'**********************
'Close Business Objects
'**********************
appint.Interactive = True
appint.Quit
'*************
'Close Objects
'*************
Set objRpt = Nothing
Set objDoc = Nothing
Set appint = Nothing
Set objMail = Nothing
Set appint = Nothing
Set vars = Nothing
Thanks,
HW
'***********************
'Runs List for all departments
'***********************
dim appint
dim strFile
dim vars
dim objDoc
dim objRpt
Set appint = CreateObject("BusinessObjects.Application")
Set objMail = CreateObject("Persits.MailSender")
Set vars = appint.Variables
appint.Interactive = False
appint.Visible = True
'******************************
'Connect to Business Objects
'prints List report
'******************************
With appint
.LoginAs "username","password"
strReportName = "List"
Set objDoc = appint.Documents.Open(strReportName)
vars.Item("dept").value = "A"
objDoc.Refresh
objDoc.PrintOut("PRINTER")
objDoc.Close
End With
'**********************
'Close Business Objects
'**********************
appint.Interactive = True
appint.Quit
'*************
'Close Objects
'*************
Set objRpt = Nothing
Set objDoc = Nothing
Set appint = Nothing
Set objMail = Nothing
Set appint = Nothing
Set vars = Nothing