Hello, everybody. Sorry for my terrible english in advance. I hope, you'll help find me find out, what am i doing wrong)
I have a project, which i want to run by schedule. EG created default VBscript (Tools->Schedule Project how it was written in manual).
'shut down the app
If not (app Is Nothing) Then
Set app = Nothing
On Error Resume Next
' Start up Enterprise Guide using the project name
prjName = "C:\SAS\sending_test.egp" 'Project Name
Set app = CreateObject("SASEGObjectModel.Application.4")
If Checkerror("CreateObject") = True Then
' open the project
Set prjObject = app.Open(prjName,"")
If Checkerror("app.Open") = True Then
' run the project
If Checkerror("Project.run") = True Then
' Save the new project
If Checkerror("Project.Save") = True Then
' Close the project
If Checkerror("Project.Close") = True Then
Checkerror = False
If Err.Number <> 0 Then
strmsg = "Error #" & Hex(Err.Number) & vbCrLf & "In Function " & fnName & vbCrLf & Err.Description
'MsgBox strmsg 'Uncomment this line if you want to be notified via MessageBox of Errors in the script.
Checkerror = True
When i' m trying to run this script, nothing happens!
I tried to delete error check from my script, ones again run it and recieved th message from Windows Script Host: Unable to connect to server: SASMain.
So to run project i'm forced to push the button "run branch from .... task", then enter login and password to connect to server! Is it possible to correct my script so, that connection to server and running of my tasks occurs automatic?
Anyhow, I do not know anything about Visual Basic programming, so I'll just assume that you wrote everything right; what I do know is that to schedule an EG project you should create (if EG doesn't do it for you), an Scheduled Task in Windows Control Panel.
Identify the task that corresponds to your Project and set the USERID & PASSWORD you'll use in there. If you're working on a remote SAS server, make sure that your UserId starts with the Windows Domain. i.e. domain\userid.
PS: If you double-click on the task and it doesn't run immediatly, it means that there's something wrong with the code.