<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Passing Prompt values to SAS Stored Procedure using SAS Excel ADD-in VBA in Developers</title>
    <link>https://communities.sas.com/t5/Developers/Passing-Prompt-values-to-SAS-Stored-Procedure-using-SAS-Excel/m-p/352589#M5341</link>
    <description>&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;I am trying to trigger (run) a SAS stored process from Excel using SAS Excel ADDIn using VBA code. I am able to trigger Stored Process and get output in Excel. But when I am passing prompt values via VBA it is giving a "Run-time Error 429" as mentioned in the attached file. Please find my code below -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sub InsertStoredProcesswithInputStream()&lt;/P&gt;&lt;P&gt;Application.DisplayStatusBar = True&lt;BR /&gt;Application.StatusBar = "Please Wait. Connecting SAS EG..."&lt;BR /&gt;&lt;BR /&gt;Dim sas As SASExcelAddIn&lt;BR /&gt;Set sas = Application.COMAddIns.Item("SAS.ExcelAddIn").Object&lt;BR /&gt;&lt;BR /&gt;Dim rngRange As Range&lt;BR /&gt;Set rngRange = Range(Cells(5, 1), Cells(Rows.Count, 1)).EntireRow&lt;BR /&gt;rngRange.ClearContents&lt;BR /&gt;&lt;BR /&gt;Dim a1 As Range&lt;BR /&gt;Set a1 = Sheet1.Range("A5")&lt;BR /&gt;&lt;BR /&gt;Dim prompts As SASPrompts&lt;BR /&gt;Set prompts = New SASPrompts&lt;BR /&gt;prompts.Add "dpt_nm", "Living"&lt;BR /&gt;&lt;BR /&gt;sas.InsertStoredProcess "/Shared Data/ACoE_Stored_Processes_Test/reorder_sheet_test2", a1, prompts&lt;BR /&gt;&lt;BR /&gt;End Sub&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;without this -&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Dim prompts As SASPrompts&lt;BR /&gt;Set prompts = New SASPrompts&lt;BR /&gt;prompts.Add "dpt_nm", "Living"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code runs fine and gives desired output.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, when I opened VBA I couldn't find SAS ADD-in 7.1 for Microsoft Office under tools-&amp;gt;references&lt;/P&gt;&lt;P&gt;So, I browsed and selected "SAS.OfficeAddin.tlb" from sas installation folder from program files. after that I got SAS ADD-in 7.1 in the tools-&amp;gt;references&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help me resolve this issue&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13739i751BC5B4785FBC75/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="SAS Excel ADDin Run-time error.jpg" title="SAS Excel ADDin Run-time error.jpg" /&gt;</description>
    <pubDate>Sun, 23 Apr 2017 12:00:28 GMT</pubDate>
    <dc:creator>VinitXen</dc:creator>
    <dc:date>2017-04-23T12:00:28Z</dc:date>
    <item>
      <title>Passing Prompt values to SAS Stored Procedure using SAS Excel ADD-in VBA</title>
      <link>https://communities.sas.com/t5/Developers/Passing-Prompt-values-to-SAS-Stored-Procedure-using-SAS-Excel/m-p/352589#M5341</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;&lt;P&gt;I am trying to trigger (run) a SAS stored process from Excel using SAS Excel ADDIn using VBA code. I am able to trigger Stored Process and get output in Excel. But when I am passing prompt values via VBA it is giving a "Run-time Error 429" as mentioned in the attached file. Please find my code below -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sub InsertStoredProcesswithInputStream()&lt;/P&gt;&lt;P&gt;Application.DisplayStatusBar = True&lt;BR /&gt;Application.StatusBar = "Please Wait. Connecting SAS EG..."&lt;BR /&gt;&lt;BR /&gt;Dim sas As SASExcelAddIn&lt;BR /&gt;Set sas = Application.COMAddIns.Item("SAS.ExcelAddIn").Object&lt;BR /&gt;&lt;BR /&gt;Dim rngRange As Range&lt;BR /&gt;Set rngRange = Range(Cells(5, 1), Cells(Rows.Count, 1)).EntireRow&lt;BR /&gt;rngRange.ClearContents&lt;BR /&gt;&lt;BR /&gt;Dim a1 As Range&lt;BR /&gt;Set a1 = Sheet1.Range("A5")&lt;BR /&gt;&lt;BR /&gt;Dim prompts As SASPrompts&lt;BR /&gt;Set prompts = New SASPrompts&lt;BR /&gt;prompts.Add "dpt_nm", "Living"&lt;BR /&gt;&lt;BR /&gt;sas.InsertStoredProcess "/Shared Data/ACoE_Stored_Processes_Test/reorder_sheet_test2", a1, prompts&lt;BR /&gt;&lt;BR /&gt;End Sub&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;without this -&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Dim prompts As SASPrompts&lt;BR /&gt;Set prompts = New SASPrompts&lt;BR /&gt;prompts.Add "dpt_nm", "Living"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Code runs fine and gives desired output.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, when I opened VBA I couldn't find SAS ADD-in 7.1 for Microsoft Office under tools-&amp;gt;references&lt;/P&gt;&lt;P&gt;So, I browsed and selected "SAS.OfficeAddin.tlb" from sas installation folder from program files. after that I got SAS ADD-in 7.1 in the tools-&amp;gt;references&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help me resolve this issue&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13739i751BC5B4785FBC75/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="SAS Excel ADDin Run-time error.jpg" title="SAS Excel ADDin Run-time error.jpg" /&gt;</description>
      <pubDate>Sun, 23 Apr 2017 12:00:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Passing-Prompt-values-to-SAS-Stored-Procedure-using-SAS-Excel/m-p/352589#M5341</guid>
      <dc:creator>VinitXen</dc:creator>
      <dc:date>2017-04-23T12:00:28Z</dc:date>
    </item>
    <item>
      <title>Re: Passing Prompt values to SAS Stored Procedure using SAS Excel ADD-in VBA</title>
      <link>https://communities.sas.com/t5/Developers/Passing-Prompt-values-to-SAS-Stored-Procedure-using-SAS-Excel/m-p/391494#M5342</link>
      <description>&lt;P&gt;I would suggest that you change the way that you create the SASPrompts object.&amp;nbsp; Try the following:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim prompts As SASPrompts&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set prompts = sas.CreateSASPromptsObject&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Creating the SASPrompts this way allows the add-in to create it within our process and there are less problems.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tim Beese&lt;/P&gt;</description>
      <pubDate>Tue, 29 Aug 2017 14:40:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/Passing-Prompt-values-to-SAS-Stored-Procedure-using-SAS-Excel/m-p/391494#M5342</guid>
      <dc:creator>TimBeese</dc:creator>
      <dc:date>2017-08-29T14:40:23Z</dc:date>
    </item>
  </channel>
</rss>

