Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.72 KB | None | 0 0
  1. Sub InsertStoredProcessWithPrompts()
  2.  
  3. Dim sas As SASExcelAddIn
  4. Set sas = Application.COMAddIns.Item("SAS.ExcelAddIn").Object
  5.  
  6.  
  7. 'Delete and entries in the existing log
  8.  
  9. sas.ClearLog
  10.  
  11. 'Setting Options
  12.  
  13. sas.options.ResetAll
  14. sas.options.AutoInsertResultsIntoDocument = True
  15. sas.options.PromptForParametersOnRefreshMultiple = False
  16. sas.options.ShowStatusWindow = False
  17.  
  18. 'Specify the Cell Used For Parameter Input
  19.  
  20. Dim age As Range
  21. Set age = Sheet1.Range("A1")
  22.  
  23. 'Capture The Prompts To Be Used As Parameters Within The Stored Process
  24.  
  25. Dim prompts As SASPrompts
  26. Set prompts = sas.CreateSASPromptsObject
  27.  
  28. prompts.Add "AGE", age
  29.  
  30. Dim stp As SASStoredProcess
  31. Set stp = sas.InsertStoredProcess("/User Folders/scmitchell/My Folder/Test Streams", Sheet1.Range("A10"), prompts)
  32.  
  33.  
  34. End Sub
  35.  
  36. Sub InsertStoredProcessWithPrompts()
  37.  
  38. Dim sas As SASExcelAddIn
  39. Set sas = Application.COMAddIns.Item("SAS.ExcelAddIn").Object
  40.  
  41. If stp Is Nothing Then
  42.  
  43. 'Delete and entries in the existing log
  44.  
  45. sas.ClearLog
  46.  
  47. 'Setting Options
  48.  
  49. sas.options.ResetAll
  50. sas.options.AutoInsertResultsIntoDocument = True
  51. sas.options.PromptForParametersOnRefreshMultiple = False
  52. sas.options.ShowStatusWindow = False
  53.  
  54. 'Specify the Cell Used For Parameter Input
  55.  
  56. Dim age As Range
  57. Set age = Sheet1.Range("A1")
  58.  
  59. 'Capture The Prompts To Be Used As Parameters Within The Stored Process
  60.  
  61. Dim prompts As SASPrompts
  62. Set prompts = sas.CreateSASPromptsObject
  63.  
  64. prompts.Add "AGE", age
  65.  
  66. Dim stp As SASStoredProcess
  67. Set stp = sas.InsertStoredProcess("/User Folders/scmitchell/My Folder/Test Streams", Sheet1.Range("A10"), prompts)
  68.  
  69. Else
  70. Set stp = stp.Modify("Test Streams")
  71.  
  72. End If
  73.  
  74. End Sub
  75.  
  76. Dim stp As SASStoredProcess
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement