Usage Note 11748: VBScript example to execute PFD within an Enterprise Guide project file
The code included below is a VBScript example that will execute a PFD
within an Enterprise Guide project file. Please refer to the Ole
Automation section in Enterprise Guide Help for documentation for
getting started and for downloading MS files necessary for running
VBScript programs.
'This VBScript example will execute a PFD called ProcessFlow1,
'which is within a project called ProcessFlowProject.seg.
'The results from the Summary Statistics task associated with a table
'called SASHELP.CLASS
'within the PFD, will then be saved to an html file.
'The results from the Bar Chart task associated with a table called
'SASHELP.AIR
'within the PFD, will then be saved to a second html file.
Dim objGuide
Dim objProject
Set objGuide = WScript.CreateObject("SASEGuide.Application")
Set objProject =
objGuide.Open("c:\userdata\vbscript\ProcessFlowProject.seg")
'---- Run ProcessFlow1 which could be any of several PFDs in
ProcessFlowProject.seg
Dim objPfd
Set objPfd=objProject.ProjectItems("ProcessFlow1")
objPfd.Run
'---- Get the results generated by the Summary Statistics task linked to
'---- the data table, SASHELP.Class
Dim objSummaryStatisticsResults
Set
objSummaryStatisticsResults=objProject.ProjectItems("CLASS").Tasks("Summ
ary Statistics").Results("HTML")
'---- Save the Summary Statistics results to an html file on the server
objSummaryStatisticsResults.SaveAs
("C:\userdata\vbscript\ProcessFlowProjectSummaryStatistics.html")
'---- Get the results generated by the Bar Chart task linked to the data
'---- table, SASHELP.AIR
Dim objBarChartResults
Set objBarChartResults=objProject.ProjectItems("AIR").Tasks("Bar
Chart").Results("HTML")
'---- Save the Bar Chart results to an html file on the server
objBarChartResults.SaveAs
("C:\userdata\vbscript\ProcessFlowProjectBarChart.html")
objProject.Close
objGuide.Quit
Operating System and Release Information
| SAS System | SAS Enterprise Guide | Microsoft Windows XP Professional | 2.0 | | 9 TS M0 | |
| Microsoft Windows NT Workstation | 2.0 | | 9 TS M0 | |
| Microsoft Windows 2000 Professional | 2.0 | | 9 TS M0 | |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
| Date Modified: | 2004-02-16 16:40:44 |
| Date Created: | 2004-02-06 14:13:33 |