<?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: SAS error when invoked by Excel VBA in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-error-when-invoked-by-Excel-VBA/m-p/370579#M275753</link>
    <description>&lt;P&gt;Not sure how to change the environment variable when its launching from excel. &amp;nbsp;Yet, when I just click on SAS to open an issue, there is no need to change the environment variable since it opens normally.&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;</description>
    <pubDate>Mon, 26 Jun 2017 13:53:29 GMT</pubDate>
    <dc:creator>suncawy</dc:creator>
    <dc:date>2017-06-26T13:53:29Z</dc:date>
    <item>
      <title>SAS error when invoked by Excel VBA</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-error-when-invoked-by-Excel-VBA/m-p/370409#M275750</link>
      <description>&lt;P&gt;I&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;know launching PC SAS from excel VBA might be old, but this&amp;nbsp;code use to work on a 32 bit windows machine&lt;/P&gt;
&lt;P&gt;when I used Excel Vba:&lt;/P&gt;
&lt;P&gt;Dim SAS As Object&lt;/P&gt;
&lt;P&gt;Set SAS = CreateObject("SAS.Application")&lt;/P&gt;
&lt;P&gt;SAS.Visible = True&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now, that our IT department gave me a 64 bit windows machine I get the following error in SAS: "Error: Configuration file "%_SASHOME%\SASFoundation\9.4\SASV9.CFG"" is unreadable."&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The funny thing is that the error occurs only when invoking SAS from excel vba. &amp;nbsp;If I start SAS by clicking on the actual program, it launches SAS normally. &amp;nbsp;The machine has SAS 9.4 64 bit installed. Also, its has office 365 ( Excel 2016).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anybody with a solution ? is it because of the 64 bit installation of SAS ? Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2017 01:32:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-error-when-invoked-by-Excel-VBA/m-p/370409#M275750</guid>
      <dc:creator>suncawy</dc:creator>
      <dc:date>2017-06-26T01:32:51Z</dc:date>
    </item>
    <item>
      <title>Re: SAS error when invoked by Excel VBA</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-error-when-invoked-by-Excel-VBA/m-p/370419#M275751</link>
      <description>&lt;P&gt;What happens when you run the command&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;type %_SASHOME%\SASFoundation\9.4\SASV9.CFG&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2017 03:25:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-error-when-invoked-by-Excel-VBA/m-p/370419#M275751</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2017-06-26T03:25:53Z</dc:date>
    </item>
    <item>
      <title>Re: SAS error when invoked by Excel VBA</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-error-when-invoked-by-Excel-VBA/m-p/370420#M275752</link>
      <description>&lt;P&gt;Also, I reckon the&amp;nbsp;environment variable&amp;nbsp;should be called &lt;FONT face="courier new,courier"&gt;SASHOME&lt;/FONT&gt;, not _&lt;FONT face="courier new,courier"&gt;SASHOME&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2017 03:28:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-error-when-invoked-by-Excel-VBA/m-p/370420#M275752</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2017-06-26T03:28:58Z</dc:date>
    </item>
    <item>
      <title>Re: SAS error when invoked by Excel VBA</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-error-when-invoked-by-Excel-VBA/m-p/370579#M275753</link>
      <description>&lt;P&gt;Not sure how to change the environment variable when its launching from excel. &amp;nbsp;Yet, when I just click on SAS to open an issue, there is no need to change the environment variable since it opens normally.&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2017 13:53:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-error-when-invoked-by-Excel-VBA/m-p/370579#M275753</guid>
      <dc:creator>suncawy</dc:creator>
      <dc:date>2017-06-26T13:53:29Z</dc:date>
    </item>
    <item>
      <title>Re: SAS error when invoked by Excel VBA</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-error-when-invoked-by-Excel-VBA/m-p/370611#M275754</link>
      <description>&lt;P&gt;if %_SASHOME% resolves to a valid path when entered in the adress bar then your windows environment variable is correct. If not I would try %SASHOME%&lt;/P&gt;&lt;P&gt;That's one thing.&lt;/P&gt;&lt;P&gt;The second thing is that the paths in your config file may have changed, you will need to check them too.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2017 14:39:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-error-when-invoked-by-Excel-VBA/m-p/370611#M275754</guid>
      <dc:creator>Oligolas</dc:creator>
      <dc:date>2017-06-26T14:39:09Z</dc:date>
    </item>
    <item>
      <title>Re: SAS error when invoked by Excel VBA</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-error-when-invoked-by-Excel-VBA/m-p/370775#M275755</link>
      <description>&lt;P&gt;Can you reply to the question above?&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jun 2017 23:44:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-error-when-invoked-by-Excel-VBA/m-p/370775#M275755</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2017-06-26T23:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: SAS error when invoked by Excel VBA</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-error-when-invoked-by-Excel-VBA/m-p/370776#M275756</link>
      <description>I'm not sure where I enter this.  Do I put it in the SAS editor ?  Do I put the word "type"?</description>
      <pubDate>Mon, 26 Jun 2017 23:57:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-error-when-invoked-by-Excel-VBA/m-p/370776#M275756</guid>
      <dc:creator>suncawy</dc:creator>
      <dc:date>2017-06-26T23:57:13Z</dc:date>
    </item>
    <item>
      <title>Re: SAS error when invoked by Excel VBA</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-error-when-invoked-by-Excel-VBA/m-p/370784#M275757</link>
      <description>&lt;P&gt;You run this in the DOS command line window.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2017 01:15:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-error-when-invoked-by-Excel-VBA/m-p/370784#M275757</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2017-06-27T01:15:58Z</dc:date>
    </item>
    <item>
      <title>Re: SAS error when invoked by Excel VBA</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-error-when-invoked-by-Excel-VBA/m-p/370795#M275758</link>
      <description>&lt;P&gt;So, the result I get is that It can't find the path "%_SASHOME%\SASFoundation\9.4\SASV9.CFG".&amp;nbsp; That makes sense because SAS 9.4 is installed in the following:&amp;nbsp; C:\Program Files\SASHOME\SASFoundation\9.4.&amp;nbsp;&amp;nbsp; Yes, the initial configuration file is there and then points to \nl\en\SASV9.CFG.&amp;nbsp; It's odd that excel invokes it to that incorrect directory, but the SAS application itself opens it correctly.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2017 03:13:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-error-when-invoked-by-Excel-VBA/m-p/370795#M275758</guid>
      <dc:creator>suncawy</dc:creator>
      <dc:date>2017-06-27T03:13:29Z</dc:date>
    </item>
    <item>
      <title>Re: SAS error when invoked by Excel VBA</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-error-when-invoked-by-Excel-VBA/m-p/370818#M275759</link>
      <description>&lt;P&gt;And what do you get when you run this:&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;set | find "SAS"&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2017 06:17:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-error-when-invoked-by-Excel-VBA/m-p/370818#M275759</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2017-06-27T06:17:05Z</dc:date>
    </item>
    <item>
      <title>Re: SAS error when invoked by Excel VBA</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-error-when-invoked-by-Excel-VBA/m-p/370950#M275760</link>
      <description>&lt;P&gt;There's a lot references. Does show "C:\program files\SASHOME\x86\Secure\ccme4". Don't know what that means, but I don't see anything related to SAS in the "C:\program files(x86)".&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2017 14:19:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-error-when-invoked-by-Excel-VBA/m-p/370950#M275760</guid>
      <dc:creator>suncawy</dc:creator>
      <dc:date>2017-06-27T14:19:59Z</dc:date>
    </item>
    <item>
      <title>Re: SAS error when invoked by Excel VBA</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-error-when-invoked-by-Excel-VBA/m-p/371064#M275761</link>
      <description>&lt;P&gt;Please paste the results here.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2017 21:41:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-error-when-invoked-by-Excel-VBA/m-p/371064#M275761</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2017-06-27T21:41:01Z</dc:date>
    </item>
    <item>
      <title>Re: SAS error when invoked by Excel VBA</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-error-when-invoked-by-Excel-VBA/m-p/371076#M275762</link>
      <description>&lt;P&gt;&lt;IMG title="Capture.JPG" alt="Capture.JPG" src="https://communities.sas.com/t5/image/serverpage/image-id/9904iF246BCA3770060C5/image-size/original?v=1.0&amp;amp;px=-1" border="0" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2017 22:34:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-error-when-invoked-by-Excel-VBA/m-p/371076#M275762</guid>
      <dc:creator>suncawy</dc:creator>
      <dc:date>2017-06-27T22:34:17Z</dc:date>
    </item>
    <item>
      <title>Re: SAS error when invoked by Excel VBA</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-error-when-invoked-by-Excel-VBA/m-p/371079#M275763</link>
      <description>&lt;P&gt;This does not look right. It's as if SAS was not installed there.&lt;/P&gt;
&lt;P&gt;You have none of the expected environment variables, such as SASHOME, SASROOT, SASCFG, etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A quick fix to make the reference VBA call work would be to create the environment variable _SASHOME&amp;nbsp; pointing to wherever the config file is. Something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="courier new,courier"&gt;set _SASHOME=C:\Program Files\SASHOME\SASFoundation\9.4\SASV9.CFG&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;You do this for the whole Windows session not just in a DOS command line Window.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;But something is not right with your installation it seems.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2017 22:53:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-error-when-invoked-by-Excel-VBA/m-p/371079#M275763</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2017-06-27T22:53:44Z</dc:date>
    </item>
    <item>
      <title>Re: SAS error when invoked by Excel VBA</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-error-when-invoked-by-Excel-VBA/m-p/371643#M275764</link>
      <description>&lt;P&gt;SAS is installed but the environment variable _SASHOME is not defined. Consult your IT and describe the problem, that's part of their job. You could do it by yourself, but then it's your responsability if something goes wrong.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jun 2017 12:08:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-error-when-invoked-by-Excel-VBA/m-p/371643#M275764</guid>
      <dc:creator>Oligolas</dc:creator>
      <dc:date>2017-06-29T12:08:35Z</dc:date>
    </item>
  </channel>
</rss>

