I am trying to get the output of the following SAS stored procedure to appear in an Excel sheet via a VBA macro.
proc sql; CREATE TABLE RV_LIST AS SELECT F_RS_DESC FROM FUTURA.to_rv_Sets WHERE F_RS_PROV_ID = 23 And UPPER(F_RS_DESC) LIKE '%LIVE RV%' ORDER BY F_RS_DATE DESC; quit; proc print DATA=RV_LIST; run;
Here is the VBA code I'm using:
Sub UpdateDataValidation()
Dim DV As Worksheet
Dim SAS As SASExcelAddIn
Dim prompt As SASPrompts
Dim Output As Range
Dim data As SASDataView
Set DV = ThisWorkbook.Worksheets("Data Validation")
Set SAS = Application.COMAddIns.Item("SAS.ExcelAddIn").Object
SAS.InsertStoredProcess "/User Folders/rbarua/My Folder/RVListUpdate", DV.Range("A4")
End SubThe VBA macro runs successfully and the output of the SAS stored process appears in the "SAS Add-In For Microsoft Office" pane on the right.
However, I want the output to appear in cell A4 of the "Data Validation" worksheet. Can anyone spot why this is not happening?
Any help is much appreciated.
Have you seen the examples in the documentation?
April 27 – 30 | Gaylord Texan | Grapevine, Texas
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!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.