> Check the SAS support
http://support.sas.com/
> website - much info and reference resources to be
> found there. Also, check the SAS forums archive as
> well.
>
> Scott Barry
> SBBWorks, Inc.
>
> Suggested Google advanced search argument, this
> topic/post:
> enterprise guide launch project site:sas.com
Thanks !
I found something which could be interesting but ... I 'm quite noob in VBS.
The original code I found in the support.sas in the following (see here attached under).
I just need a "quite simpler script" which will launch SE Guide and run the processflow.
Is somebody able to help me with this ? :s
Thanks
- - - - - -
Option Explicit
Dim app ' As SASEGuide.Application
Dim prjName ' As String
Dim prjObject ' As SASEGuide.Project
Dim PFDName ' As String
Dim PFDObject ' As SASEGuide.ProcessFlow
Dim pfdColl ' As SASEGuide.ProcessFlowCollection
prjName = "C:\Documents and Settings\PFD_Order.egp" ' Project Name
Call dowork2
Call dowork1
Call dowork3
Call CloseAndQuit
Sub dowork2()
On Error Resume Next
'----
' Start up Enterprise Guide using the project name
'----
PFDName = "PFD2" ' PFD Name
Set app = CreateObject("SASEGObjectModel.Application")
If Checkerror("CreateObject") = True Then
Exit Sub
End If
Set prjObject = app.Open(prjName,"")
If Checkerror("App.Open") = True Then
Exit Sub
End If
'-----
'Get The PFD Collection and Object
'-----
Set pfdColl = prjObject.ProcessFlowCollection
If Checkerror("Project.ProcessFlowCollection") = True Then
Exit Sub
End If
Dim i ' As Long
Dim count ' As Long
count = pfdColl.count
For i = 0 To count
Set PFDObject = pfdColl.Item(i)
If Checkerror("ProcessFlowCollection.Item") = True Then
Exit Sub
End If
If (PFDObject.Name = pfdName) Then
Exit For
Else
Set PFDObject = Nothing
End If
Next
If not (PFDObject Is Nothing) Then
'----
' Run the PFD
'----
PFDObject.Run
If Checkerror("ProcessFlow.Run") = True Then
Exit Sub
End If
End If
End Sub
Sub dowork1()
On Error Resume Next
'----
' Start up Enterprise Guide using the project name
'----
PFDName = "PFD1" ' PFD Name
'-----
'Get The PFD Collection and Object
'-----
Set pfdColl = prjObject.ProcessFlowCollection
If Checkerror("Project.ProcessFlowCollection") = True Then
Exit Sub
End If
Dim i ' As Long
Dim count ' As Long
count = pfdColl.count
For i = 0 To count
Set PFDObject = pfdColl.Item(i)
If Checkerror("ProcessFlowCollection.Item") = True Then
Exit Sub
End If
If (PFDObject.Name = pfdName) Then
Exit For
Else
Set PFDObject = Nothing
End If
Next
If not (PFDObject Is Nothing) Then
'----
' Run the PFD
'----
PFDObject.Run
If Checkerror("ProcessFlow.Run") = True Then
Exit Sub
End If
End If
End Sub
Sub dowork3()
On Error Resume Next
'----
' Start up Enterprise Guide using the project name
'----
PFDName = "PFD3" ' PFD Name
'-----
'Get The PFD Collection and Object
'-----
Set pfdColl = prjObject.ProcessFlowCollection
If Checkerror("Project.ProcessFlowCollection") = True Then
Exit Sub
End If
Dim i ' As Long
Dim count ' As Long
count = pfdColl.count
For i = 0 To count
Set PFDObject = pfdColl.Item(i)
If Checkerror("ProcessFlowCollection.Item") = True Then
Exit Sub
End If
If (PFDObject.Name = pfdName) Then
Exit For
Else
Set PFDObject = Nothing
End If
Next
If not (PFDObject Is Nothing) Then
'----
' Run the PFD
'----
PFDObject.Run
If Checkerror("ProcessFlow.Run") = True Then
Exit Sub
End If
End If
End Sub
Sub CloseAndQuit()
' Save the new project
'-----
prjObject.Save
If Checkerror("Project.Save") = True Then
Exit Sub
End If
'-----
' Close the project
'-----
prjObject.Close
If Checkerror("Project.Close") = True Then
Exit Sub
End If
End Sub
Function Checkerror(fnName)
Checkerror = False
Dim strmsg ' As String
Dim errNum ' As Long
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
End If
End Function
- - - - - -
Message was edited by: Fab.from.be