<?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 Execute Excel VBA Macro using SAS in Microsoft Integration with SAS</title>
    <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Execute-Excel-VBA-Macro-using-SAS/m-p/450918#M2218</link>
    <description>&lt;P&gt;I have SAS EG version 7.1 and Office 2013 Installed on my system. I am trying to run my SAS projects by calling them from VBA. As a first step, I tried to call a simple PROC step using the below code I found online:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Sub createTable()
    Dim obObjectFactory As New SASObjectManager.ObjectFactory

    Dim obObjectKeeper As New SASObjectManager.ObjectKeeper

    Dim obServer As New SASObjectManager.ServerDef

    Dim obSAS as SAS.workspace
    
    Dim query as String
    query = "PROC SQL; CREATE TABLE ME.TABLE1; RUN;"

    obServer.MachineDNSName = "XXXXXXXXX"
    obServer.Protocol = ProtocolBridge
    obServer.Port = 8561
    obObjectFactory.LogEnabled = True

    Set obSAS = obObjectFactory.CreateObjectByServer("SASApp", True, obServer, "", "")

    obSAS.LanguageService.Submit query
    
End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I'm getting an error at below line:&lt;/P&gt;&lt;PRE&gt;Set obSAS = obObjectFactory.CreateObjectByServer("SASApp", True, obServer, "", "")&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="3275_VBA ERROR.JPG" style="width: 371px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/19602i8EB57BBB45415FEF/image-size/large?v=v2&amp;amp;px=999" role="button" title="3275_VBA ERROR.JPG" alt="3275_VBA ERROR.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone please help me to move forward this error? Also, any guidance to run the SAS projects is greatly appreciated. I am new to both VBA and SAS.&lt;/P&gt;</description>
    <pubDate>Wed, 04 Apr 2018 00:14:03 GMT</pubDate>
    <dc:creator>pramod_duvvuri</dc:creator>
    <dc:date>2018-04-04T00:14:03Z</dc:date>
    <item>
      <title>Execute Excel VBA Macro using SAS</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Execute-Excel-VBA-Macro-using-SAS/m-p/450918#M2218</link>
      <description>&lt;P&gt;I have SAS EG version 7.1 and Office 2013 Installed on my system. I am trying to run my SAS projects by calling them from VBA. As a first step, I tried to call a simple PROC step using the below code I found online:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Sub createTable()
    Dim obObjectFactory As New SASObjectManager.ObjectFactory

    Dim obObjectKeeper As New SASObjectManager.ObjectKeeper

    Dim obServer As New SASObjectManager.ServerDef

    Dim obSAS as SAS.workspace
    
    Dim query as String
    query = "PROC SQL; CREATE TABLE ME.TABLE1; RUN;"

    obServer.MachineDNSName = "XXXXXXXXX"
    obServer.Protocol = ProtocolBridge
    obServer.Port = 8561
    obObjectFactory.LogEnabled = True

    Set obSAS = obObjectFactory.CreateObjectByServer("SASApp", True, obServer, "", "")

    obSAS.LanguageService.Submit query
    
End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I'm getting an error at below line:&lt;/P&gt;&lt;PRE&gt;Set obSAS = obObjectFactory.CreateObjectByServer("SASApp", True, obServer, "", "")&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="3275_VBA ERROR.JPG" style="width: 371px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/19602i8EB57BBB45415FEF/image-size/large?v=v2&amp;amp;px=999" role="button" title="3275_VBA ERROR.JPG" alt="3275_VBA ERROR.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can anyone please help me to move forward this error? Also, any guidance to run the SAS projects is greatly appreciated. I am new to both VBA and SAS.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Apr 2018 00:14:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Execute-Excel-VBA-Macro-using-SAS/m-p/450918#M2218</guid>
      <dc:creator>pramod_duvvuri</dc:creator>
      <dc:date>2018-04-04T00:14:03Z</dc:date>
    </item>
    <item>
      <title>Re: Execute Excel VBA Macro using SAS</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Execute-Excel-VBA-Macro-using-SAS/m-p/450943#M2219</link>
      <description>&lt;P&gt;Have a read &lt;A href="http://support.sas.com/rnd/itech/doc9/dev_guide/dist-obj/winclnt/omsamples.html" target="_self"&gt;here&lt;/A&gt;&amp;nbsp;(for code, but your code seems fine) and &lt;A href="https://communities.sas.com/t5/SAS-Enterprise-Guide/SAS-EG-Metadata-Server-Connection-Issue/td-p/367665" target="_self"&gt;here&lt;/A&gt;&amp;nbsp;(for a similar IT connection error).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Test your connection with&amp;nbsp;itconfig2.exe .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Apr 2018 05:06:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Execute-Excel-VBA-Macro-using-SAS/m-p/450943#M2219</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2018-04-04T05:06:54Z</dc:date>
    </item>
    <item>
      <title>Re: Execute Excel VBA Macro using SAS</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Execute-Excel-VBA-Macro-using-SAS/m-p/450949#M2220</link>
      <description>&lt;P&gt;I moved the post to "Integration with MS Office", which seems a more appropriate forum.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Apr 2018 06:13:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Execute-Excel-VBA-Macro-using-SAS/m-p/450949#M2220</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-04-04T06:13:07Z</dc:date>
    </item>
  </channel>
</rss>

