Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub InsertStoredProcessWithPrompts()
- Dim sas As SASExcelAddIn
- Set sas = Application.COMAddIns.Item("SAS.ExcelAddIn").Object
- 'Delete and entries in the existing log
- sas.ClearLog
- 'Setting Options
- sas.options.ResetAll
- sas.options.AutoInsertResultsIntoDocument = True
- sas.options.PromptForParametersOnRefreshMultiple = False
- sas.options.ShowStatusWindow = False
- 'Specify the Cell Used For Parameter Input
- Dim age As Range
- Set age = Sheet1.Range("A1")
- 'Capture The Prompts To Be Used As Parameters Within The Stored Process
- Dim prompts As SASPrompts
- Set prompts = sas.CreateSASPromptsObject
- prompts.Add "AGE", age
- Dim stp As SASStoredProcess
- Set stp = sas.InsertStoredProcess("/User Folders/scmitchell/My Folder/Test Streams", Sheet1.Range("A10"), prompts)
- End Sub
- Sub InsertStoredProcessWithPrompts()
- Dim sas As SASExcelAddIn
- Set sas = Application.COMAddIns.Item("SAS.ExcelAddIn").Object
- If stp Is Nothing Then
- 'Delete and entries in the existing log
- sas.ClearLog
- 'Setting Options
- sas.options.ResetAll
- sas.options.AutoInsertResultsIntoDocument = True
- sas.options.PromptForParametersOnRefreshMultiple = False
- sas.options.ShowStatusWindow = False
- 'Specify the Cell Used For Parameter Input
- Dim age As Range
- Set age = Sheet1.Range("A1")
- 'Capture The Prompts To Be Used As Parameters Within The Stored Process
- Dim prompts As SASPrompts
- Set prompts = sas.CreateSASPromptsObject
- prompts.Add "AGE", age
- Dim stp As SASStoredProcess
- Set stp = sas.InsertStoredProcess("/User Folders/scmitchell/My Folder/Test Streams", Sheet1.Range("A10"), prompts)
- Else
- Set stp = stp.Modify("Test Streams")
- End If
- End Sub
- Dim stp As SASStoredProcess
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement