<?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: running SAS macro from Excel VBA in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/running-SAS-macro-from-Excel-VBA/m-p/524027#M142453</link>
    <description>&lt;P&gt;The code failed after executing:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;obConnection.Open "provider=sas.iomprovider.1; SAS workspace ID=" + obSAS.UniqueIdentifier&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am getting an error that "the object could not be found; make sure it was previously added to the object keeper".&lt;/P&gt;</description>
    <pubDate>Wed, 02 Jan 2019 05:41:13 GMT</pubDate>
    <dc:creator>yanivtz</dc:creator>
    <dc:date>2019-01-02T05:41:13Z</dc:date>
    <item>
      <title>running SAS macro from Excel VBA</title>
      <link>https://communities.sas.com/t5/SAS-Programming/running-SAS-macro-from-Excel-VBA/m-p/524003#M142445</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to run SAS from Excel, using VBA.&lt;/P&gt;&lt;P&gt;Very basic.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am attaching the code. The error I am getting is: "the object could not be found; make sure it was previously added to the object keeper"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sub&amp;nbsp; Macro1 ()&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim obObjectFactory As New SASObjectManager.ObjectFactoryMulti2&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim obObjectKeeper As New SASObjectManager.ObjectKeeper&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim obConnection As New ADODB.Connection&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim obRecordSet As New ADODB.Recordset&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim errorString As String&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim sourcebuffer As String&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim height As Variant&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim weight As Variant&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; height = 180&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; weight = 180&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim obServer As New SASObjectManager.ServerDef&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; obServer.MachineDNSName = [myserver]&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; obServer.Protocol = SASObjectManager.Protocols.ProtocolBridge&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; obServer.Port = 8591&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; If (obSAS Is Nothing) Then&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Set obSAS = obObjectFactory.CreateObjectByServer("sas", True, obServer, [login],[pwd])&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; End If&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;sourcebuffer = "options sasautos=(sasautos,'X:\Actuarya\USERS\tzafiry\Madadim\bmi.sas');%bmi(" &amp;amp; height &amp;amp; "," &amp;amp; weight &amp;amp; ");"&lt;BR /&gt;obSAS.LanguageService.Submit sourcebuffer&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;obConnection.Open "provider=sas.iomprovider.1; SAS workspace ID=" + obSAS.UniqueIdentifier&lt;BR /&gt;obRecordSet.Open "work.result", obConnection, adOpenStatic, adLockReadOnly, adCmdTableDirect&lt;BR /&gt;obRecordSet.MoveFirst&lt;BR /&gt;bmi = obRecordSet(0).Value&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jan 2019 17:42:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/running-SAS-macro-from-Excel-VBA/m-p/524003#M142445</guid>
      <dc:creator>yanivtz</dc:creator>
      <dc:date>2019-01-01T17:42:14Z</dc:date>
    </item>
    <item>
      <title>Re: running SAS macro from Excel VBA</title>
      <link>https://communities.sas.com/t5/SAS-Programming/running-SAS-macro-from-Excel-VBA/m-p/524005#M142447</link>
      <description>&lt;P&gt;When setting up SASAUTOS, the paths used should be to a folder not to an individual file.&amp;nbsp; Where you have this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;'X:\Actuarya\USERS\tzafiry\Madadim\bmi.sas'&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Try replacing that with:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;'X:\Actuarya\USERS\tzafiry\Madadim'&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;When you try to use %bmi, SAS will automatically search for its definition in a file named bmi.sas.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Jan 2019 17:46:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/running-SAS-macro-from-Excel-VBA/m-p/524005#M142447</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-01-01T17:46:28Z</dc:date>
    </item>
    <item>
      <title>Re: running SAS macro from Excel VBA</title>
      <link>https://communities.sas.com/t5/SAS-Programming/running-SAS-macro-from-Excel-VBA/m-p/524027#M142453</link>
      <description>&lt;P&gt;The code failed after executing:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;obConnection.Open "provider=sas.iomprovider.1; SAS workspace ID=" + obSAS.UniqueIdentifier&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am getting an error that "the object could not be found; make sure it was previously added to the object keeper".&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jan 2019 05:41:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/running-SAS-macro-from-Excel-VBA/m-p/524027#M142453</guid>
      <dc:creator>yanivtz</dc:creator>
      <dc:date>2019-01-02T05:41:13Z</dc:date>
    </item>
    <item>
      <title>Re: running SAS macro from Excel VBA</title>
      <link>https://communities.sas.com/t5/SAS-Programming/running-SAS-macro-from-Excel-VBA/m-p/524885#M142765</link>
      <description>&lt;P&gt;Still looking for a solution... Thanks&lt;/P&gt;</description>
      <pubDate>Sun, 06 Jan 2019 13:50:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/running-SAS-macro-from-Excel-VBA/m-p/524885#M142765</guid>
      <dc:creator>yanivtz</dc:creator>
      <dc:date>2019-01-06T13:50:46Z</dc:date>
    </item>
  </channel>
</rss>

