BookmarkSubscribeRSS Feed
Madhup
Calcite | Level 5

I am developing a tool in VBA which can interact with SAS and run a particular code based on user input. The SAS prompt 'Var_list' used in the stored process can accept a list of 4 variables 'Var1', 'Var2', 'Var3', 'Var4' (These values are present in cells F12:F14). I am using the following code to pass these values to the SAS prompt but my code doesn't work. Please suggest where am I going wrong

 

 

Dim sas As SASExcelAddIn
Set sas = Application.COMAddIns.Item("SAS.ExcelAddIn").Object

Set WB = ThisWorkbook
Set BG = WB.Worksheets("Tool")


' This is how to define prompts when you add a stored process
Dim prompts As SASPrompts
Set prompts = New SASPrompts

StpName = "/List_Stp_Test"

prompts.Add "Val_list", BG.Range("F12:F15").Value    'Not working


sas.Options.ShowSASLog = True

Set a1 = Sheets("Tool").Range("F17")

Sheets("Tool").Range("A1").Select

sas.InsertStoredProcess StpName, a1, prompts

 

 

1 REPLY 1
saspert
Pyrite | Level 9

any errors/notes/warnings from the sas log? did you check this sample note out - http://support.sas.com/kb/42/983.html

there is a sugi paper too http://support.sas.com/resources/papers/proceedings11/012-2011.pdf

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1280 views
  • 0 likes
  • 2 in conversation