<?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: Trouble Executing SAS Stored Process in Excel VBA in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Trouble-Executing-SAS-Stored-Process-in-Excel-VBA/m-p/270717#M299882</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/44418"&gt;@vibeznstuff﻿&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I am inerested by your subject.&lt;/P&gt;
&lt;P&gt;Can we use&amp;nbsp; VBA and Excel to call a SAS stored processes, if we do not have a&amp;nbsp; SAS Add-In for Microsoft Office ?&lt;/P&gt;</description>
    <pubDate>Mon, 16 May 2016 16:15:53 GMT</pubDate>
    <dc:creator>LineMoon</dc:creator>
    <dc:date>2016-05-16T16:15:53Z</dc:date>
    <item>
      <title>Trouble Executing SAS Stored Process in Excel VBA</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trouble-Executing-SAS-Stored-Process-in-Excel-VBA/m-p/161941#M299880</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to execute a stored process (doesn't take any parameters) from Excel VBA but it doesn't seem to be working. It works when I run it in SAS (simply creating a table that filters on a column, this is all for testing purposes) but when I run it in Excel it doesn't seem to execute (and it doesn't crash either). I'll run the macro but when I check the output dataset it remains unchanged as if the process didn't run. When I then run it in SAS it works as expected. I'll paste the structure of my code below if anyone might be able to spot any issues that I'm missing. Also, connecting to the workspace hasn't been an issue. I've been able to pull data fine and it even seems to be finding the procedure as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*************************************************************************************************&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim obSAS As SAS.Workspace&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim obWorkspaceManager As New SASWorkspaceManager.WorkspaceManager&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim obServerDef As New SASWorkspaceManager.ServerDef&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim xmlString As String&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; obServerDef.Port = 8591&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; obServerDef.Protocol = ProtocolBridge ' Multiple hostNames can be provided&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' for failover; order is unreliable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; obServerDef.MachineDNSName = "abc.domain.com"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set obSAS = obWorkspaceManager.Workspaces.CreateWorkspaceByServer("", VisibilityProcess, obServerDef, "user", "pwd", xmlString)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim SASproc As SAS.StoredProcessService&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set SASproc = obSAS.LanguageService.StoredProcessService&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SASproc.Repository = "file:/path"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; SASproc.Execute "testSP.sas", ""&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;*************************************************************************************************&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Thanks for any help in advance. I'm pretty new to this.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Best,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 13.3333330154419px;"&gt;Richard&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Feb 2015 21:51:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trouble-Executing-SAS-Stored-Process-in-Excel-VBA/m-p/161941#M299880</guid>
      <dc:creator>vibeznstuff</dc:creator>
      <dc:date>2015-02-10T21:51:35Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble Executing SAS Stored Process in Excel VBA</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trouble-Executing-SAS-Stored-Process-in-Excel-VBA/m-p/161942#M299881</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nevermind, I found what the error was after checking the log output (should have done so from the start). I was getting a "lock is not available" error because I had the dataset/proc open on the actual SAS session and I think it was creating a conflict with my call from Excel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;source: &lt;A href="http://support.sas.com/kb/8/130.html" title="http://support.sas.com/kb/8/130.html"&gt;8130 - "Lock is not available" error message appears when running multiple SASjobs with data files pointing to the same directory&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Feb 2015 15:37:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trouble-Executing-SAS-Stored-Process-in-Excel-VBA/m-p/161942#M299881</guid>
      <dc:creator>vibeznstuff</dc:creator>
      <dc:date>2015-02-11T15:37:27Z</dc:date>
    </item>
    <item>
      <title>Re: Trouble Executing SAS Stored Process in Excel VBA</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Trouble-Executing-SAS-Stored-Process-in-Excel-VBA/m-p/270717#M299882</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/44418"&gt;@vibeznstuff﻿&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I am inerested by your subject.&lt;/P&gt;
&lt;P&gt;Can we use&amp;nbsp; VBA and Excel to call a SAS stored processes, if we do not have a&amp;nbsp; SAS Add-In for Microsoft Office ?&lt;/P&gt;</description>
      <pubDate>Mon, 16 May 2016 16:15:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Trouble-Executing-SAS-Stored-Process-in-Excel-VBA/m-p/270717#M299882</guid>
      <dc:creator>LineMoon</dc:creator>
      <dc:date>2016-05-16T16:15:53Z</dc:date>
    </item>
  </channel>
</rss>

