<?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 Running SAS Enterprise from VBA in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Running-SAS-Enterprise-from-VBA/m-p/581042#M34472</link>
    <description>&lt;P&gt;I'm trying to open up SAS Enterprise from VBA to call upon/run a different program. But I'm getting an error "2147213310 (80042002)" which I'm confused about (I've attached the exact error message).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the first time I've tried to connect from VBA to SAS so everything I have so far has been picked from codes I've found in other forums.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim obObjectFactory As New SASObjectManager.ObjectFactory&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim obObjectKeeper As New SASObjectManager.ObjectKeeper&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim obServer As New SASObjectManager.ServerDef&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim obSAS As SAS.Workspace&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim cn As New ADODB.Connection&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim rs As New ADODB.Recordset&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; obServer.MachineDNSName = "DummyName"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; obServer.Protocol = ProtocolBridge&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; obServer.Port = 8591&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; obObjectFactory.LogEnabled = True&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set obSAS = obObjectFactory.CreateObjectByServer("My Server", True, obServer, "MyUserName", "MyPassword")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The error is when I run the last line.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The SAS Profile I'm trying to connect to has been attached too.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have seen some stuff around about issues running on 32-bit SAS but I have no idea how to get around this?&lt;/P&gt;&lt;P&gt;Has anyone come across this issue before?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;</description>
    <pubDate>Wed, 14 Aug 2019 10:25:18 GMT</pubDate>
    <dc:creator>TiteJoe</dc:creator>
    <dc:date>2019-08-14T10:25:18Z</dc:date>
    <item>
      <title>Running SAS Enterprise from VBA</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Running-SAS-Enterprise-from-VBA/m-p/581042#M34472</link>
      <description>&lt;P&gt;I'm trying to open up SAS Enterprise from VBA to call upon/run a different program. But I'm getting an error "2147213310 (80042002)" which I'm confused about (I've attached the exact error message).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the first time I've tried to connect from VBA to SAS so everything I have so far has been picked from codes I've found in other forums.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim obObjectFactory As New SASObjectManager.ObjectFactory&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim obObjectKeeper As New SASObjectManager.ObjectKeeper&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim obServer As New SASObjectManager.ServerDef&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim obSAS As SAS.Workspace&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim cn As New ADODB.Connection&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim rs As New ADODB.Recordset&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; obServer.MachineDNSName = "DummyName"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; obServer.Protocol = ProtocolBridge&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; obServer.Port = 8591&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; obObjectFactory.LogEnabled = True&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set obSAS = obObjectFactory.CreateObjectByServer("My Server", True, obServer, "MyUserName", "MyPassword")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The error is when I run the last line.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The SAS Profile I'm trying to connect to has been attached too.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have seen some stuff around about issues running on 32-bit SAS but I have no idea how to get around this?&lt;/P&gt;&lt;P&gt;Has anyone come across this issue before?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you,&lt;/P&gt;</description>
      <pubDate>Wed, 14 Aug 2019 10:25:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Running-SAS-Enterprise-from-VBA/m-p/581042#M34472</guid>
      <dc:creator>TiteJoe</dc:creator>
      <dc:date>2019-08-14T10:25:18Z</dc:date>
    </item>
    <item>
      <title>Re: Running SAS Enterprise from VBA</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Running-SAS-Enterprise-from-VBA/m-p/581080#M34475</link>
      <description>&lt;P&gt;The code you shared is for connecting to SAS directly with Integration Technologies. But your screenshots show that you have SAS Enterprise Guide or the SAS Add-In for Microsoft Office.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have the SAS Add-In for Microsoft Office, &lt;A href="http://support.sas.com/resources/papers/proceedings11/012-2011.pdf" target="_self"&gt;start with this paper to learn about VBA and scripting.&lt;/A&gt;&amp;nbsp; &amp;nbsp;Here's a &lt;A href="http://support.sas.com/resources/papers/proceedings16/SAS3500-2016.pdf" target="_self"&gt;broader, more recent paper from the same expert&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you have SAS Enterprise Guide, &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/Doing-More-with-SAS-Enterprise-Guide-Automation/ta-p/417832" target="_self"&gt;then start with this article about EG Automation&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to connect to SAS directly and bypass SAS Enterprise Guide and the SAS Add-In for Microsoft Office (though that is more work so I recommend scripting through one of the clients instead), &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/Create-your-own-client-apps-using-SAS-Integration-Technologies/ta-p/418253" target="_self"&gt;check out this article&lt;/A&gt; and code &lt;A href="https://github.com/sassoftware/sas-inttech-samples" target="_self"&gt;samples on GitHub&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Aug 2019 12:40:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Running-SAS-Enterprise-from-VBA/m-p/581080#M34475</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2019-08-14T12:40:21Z</dc:date>
    </item>
  </channel>
</rss>

