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 Sub
The 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?
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.