<?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 Re: SASRanges.Add not working in VBA in Microsoft Integration with SAS</title>
    <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/SASRanges-Add-not-working-in-VBA/m-p/522575#M2331</link>
    <description>&lt;P&gt;I took a look at the VBA that you're using and at first glance everything looks correct.&amp;nbsp; I attempted to replicate your issue and created my own stored process that used two input streams, and I was able to get it to work correctly.&amp;nbsp; The only thing that I changed from your example was the path of the stored process (pointed to my own), and the names of the input streams.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I used Enterprise Guide to create my stored process and in doing so, I was restricted to 8 characters for the name of my input stream in the stored process wizard.&amp;nbsp; Your 2nd input stream is defined as "VARIAVEIS", which is 9 characters.&amp;nbsp; Perhaps there is a limit on the length of the stream name?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would suggest using stream names that are 8 or less characters to see if that makes a difference.&amp;nbsp; I used stream1 and stream2.&amp;nbsp; If there is some sort of limit being enforced, perhaps going through the UI handles that for you, but when automating, it does not.&amp;nbsp; Maybe the longer stream name is causing some sort of problem on the server that makes both streams invalid?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Other than the stream length, it looks correct to me.&amp;nbsp; The streams variable is a SAS Add-In scripting variable that stores the name/range internally, so from the VBA debugger it may look empty but not necessarily be empty.&amp;nbsp; When I looked at that field in my VBA debugger it didn't show anything, but my stored process executed cleanly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;Tim Beese&lt;/P&gt;</description>
    <pubDate>Wed, 19 Dec 2018 15:32:02 GMT</pubDate>
    <dc:creator>TimBeese</dc:creator>
    <dc:date>2018-12-19T15:32:02Z</dc:date>
    <item>
      <title>SASRanges.Add not working in VBA</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/SASRanges-Add-not-working-in-VBA/m-p/522167#M2323</link>
      <description>&lt;P&gt;I have the following code that is not working. The streams variable is not receiving the values I'm trying to pass to it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;1 Sub INSERTSTOREDPROCESSWITHINPUTSTREAMS()
2   Dim sas As SASExcelAddIn
3   Set sas = Application.COMAddIns.Item("SAS.ExcelAddIn").Object
4   Dim streams As SASRanges
5   Set streams = sas.CreateSASRangesObject
6   streams.Add "ENTSAIDA", Worksheets("EntradaSaida").Range("A1:B13")
7   streams.Add "VARIAVEIS", Worksheets("Variaveis").Range("A1", "I7")
8   sas.InsertStoredProcess "/User Folders/antonaci(1)/My Folder/Credibilidade", Worksheets("Plan1").Range("A1"), , , streams
9 End Sub&lt;/PRE&gt;&lt;P&gt;First, the StoredProcesss is working properly. If I call it from the SAS Menu and select those ranges as input it works without a problem.&lt;/P&gt;&lt;P&gt;If I run the above code I get the following error from SAS:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;136       +LIBNAME ENTSAIDA XML;
NOTE: Libref ENTSAIDA was successfully assigned as follows: 
      Engine:        XML 
      Physical Name: ENTSAIDA
137       +DATA WORK.ENTRADASAIDA;
138       +	SET ENTSAIDA.&amp;amp;_WEBIN_SASNAME;
ERROR: File ENTSAIDA.EXCEL_TABLE.DATA does not exist.
139       +RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;If I mark the VBA code to pause right before line 8 and check the streams variable, it is empty.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also tried to use the following code in line 5, but I get the same results.&lt;/P&gt;&lt;PRE&gt;5 Set streams = New SASRanges&lt;/PRE&gt;&lt;P&gt;Also,&lt;/P&gt;&lt;PRE&gt;Worksheets("EntradaSaida").Range("A1:B13").Select&lt;/PRE&gt;&lt;P&gt;selects the range I want, so I'm sure I didn't misspelled the sheet name.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone have any idea what may be happening?&lt;/P&gt;&lt;P&gt;I'm using:&lt;/P&gt;&lt;P&gt;SAS Add-In for Microsoft Office 7.15 HF7 (7.100.5.6182)&lt;/P&gt;&lt;P&gt;Microsoft Excel 2013 (15.0.5059.1000)&lt;/P&gt;</description>
      <pubDate>Tue, 18 Dec 2018 12:01:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/SASRanges-Add-not-working-in-VBA/m-p/522167#M2323</guid>
      <dc:creator>gantonaci</dc:creator>
      <dc:date>2018-12-18T12:01:20Z</dc:date>
    </item>
    <item>
      <title>Re: SASRanges.Add not working in VBA</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/SASRanges-Add-not-working-in-VBA/m-p/522575#M2331</link>
      <description>&lt;P&gt;I took a look at the VBA that you're using and at first glance everything looks correct.&amp;nbsp; I attempted to replicate your issue and created my own stored process that used two input streams, and I was able to get it to work correctly.&amp;nbsp; The only thing that I changed from your example was the path of the stored process (pointed to my own), and the names of the input streams.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I used Enterprise Guide to create my stored process and in doing so, I was restricted to 8 characters for the name of my input stream in the stored process wizard.&amp;nbsp; Your 2nd input stream is defined as "VARIAVEIS", which is 9 characters.&amp;nbsp; Perhaps there is a limit on the length of the stream name?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would suggest using stream names that are 8 or less characters to see if that makes a difference.&amp;nbsp; I used stream1 and stream2.&amp;nbsp; If there is some sort of limit being enforced, perhaps going through the UI handles that for you, but when automating, it does not.&amp;nbsp; Maybe the longer stream name is causing some sort of problem on the server that makes both streams invalid?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Other than the stream length, it looks correct to me.&amp;nbsp; The streams variable is a SAS Add-In scripting variable that stores the name/range internally, so from the VBA debugger it may look empty but not necessarily be empty.&amp;nbsp; When I looked at that field in my VBA debugger it didn't show anything, but my stored process executed cleanly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;Tim Beese&lt;/P&gt;</description>
      <pubDate>Wed, 19 Dec 2018 15:32:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/SASRanges-Add-not-working-in-VBA/m-p/522575#M2331</guid>
      <dc:creator>TimBeese</dc:creator>
      <dc:date>2018-12-19T15:32:02Z</dc:date>
    </item>
    <item>
      <title>Re: SASRanges.Add not working in VBA</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/SASRanges-Add-not-working-in-VBA/m-p/522643#M2332</link>
      <description>&lt;P&gt;The problem was just the name of the stream.&lt;/P&gt;&lt;P&gt;I had noticed it while debbuging but I also saw that the stream object was empty and I was&amp;nbsp;misled by that.&lt;/P&gt;&lt;P&gt;I never tried to run the process again, I was just trying to get the stream object to get the parameters.&amp;nbsp;&lt;img id="smileymad" class="emoticon emoticon-smileymad" src="https://communities.sas.com/i/smilies/16x16_smiley-mad.png" alt="Smiley Mad" title="Smiley Mad" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the help.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Dec 2018 17:35:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/SASRanges-Add-not-working-in-VBA/m-p/522643#M2332</guid>
      <dc:creator>gantonaci</dc:creator>
      <dc:date>2018-12-19T17:35:56Z</dc:date>
    </item>
  </channel>
</rss>

