BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "SEGuide.exe K:\RUN\Process\TRY.egp"""


Hello world 😉

I create a macro to launch a specfic project with SE Guide.

But ...

I would like to RUN a specific process flow (name = DATA) of the project (TRY.egp).

Is it possible to specify in the script vbs that the process flow named "DATA" has to be opened and RUN (F3) ?

If not, is there any way to do it otherwise ?

Thanks in advance.

Best regards Message was edited by: Fab.from.be
2 REPLIES 2
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
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
deleted_user
Not applicable
> 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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 1136 views
  • 0 likes
  • 2 in conversation