<?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: Run a vba excel macro with SAS in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Run-a-vba-excel-macro-with-SAS/m-p/560866#M33758</link>
    <description>Yes it is. The second thing is to check that SAS runs locally or server and then if it runs locally, verify that your path to Excel is correct. It changes for each version of Excel.</description>
    <pubDate>Wed, 22 May 2019 14:54:05 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2019-05-22T14:54:05Z</dc:date>
    <item>
      <title>Run a vba excel macro with SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Run-a-vba-excel-macro-with-SAS/m-p/560578#M33738</link>
      <description>&lt;P&gt;Hi, i want to use SAS to run a macro in a excel .xlsm file. I read this useful guide:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://blogs.sas.com/content/sasdummy/2011/05/03/using-sas-enterprise-guide-to-run-programs-in-batch/" target="_blank" rel="noopener"&gt;https://blogs.sas.com/content/sasdummy/2011/05/03/using-sas-enterprise-guide-to-run-programs-in-batch/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but i've a problem to use the filename "excel|system" option.&lt;/P&gt;&lt;P&gt;The code is:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options noxwait noxsync;
x '"C:\Program Files (x86)\Microsoft Office\Office14\EXCEL.EXE" ';
/* Sleep for 5 seconds to give Excel time to come up */
data _null_;
x=sleep(5);
run;
filename cmds dde "excel|system";

data _null_;
file cmds;
/* Open the excel file test.xlsm which contains the VBA macro */
put '[open("X:\temp\test.xlsm")]';
/* Run myVBAmacro */
put '[run("test.xlsm!myVBAmacro")]';
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;When i run a program the log give back this error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ERROR: Physical file does not exist, excel|system.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the support&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2019 17:00:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Run-a-vba-excel-macro-with-SAS/m-p/560578#M33738</guid>
      <dc:creator>FRAFLUTE</dc:creator>
      <dc:date>2019-05-21T17:00:54Z</dc:date>
    </item>
    <item>
      <title>Re: Run a vba excel macro with SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Run-a-vba-excel-macro-with-SAS/m-p/560595#M33739</link>
      <description>First verify that XCMD is enabled and that you're not running on a server. If you are, DDE isn't a process that will work for you.&lt;BR /&gt;&lt;BR /&gt;You can verify your XCMD option using hte following:&lt;BR /&gt;&lt;BR /&gt;proc options option=xcmd;run;&lt;BR /&gt;</description>
      <pubDate>Tue, 21 May 2019 17:47:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Run-a-vba-excel-macro-with-SAS/m-p/560595#M33739</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-05-21T17:47:10Z</dc:date>
    </item>
    <item>
      <title>Re: Run a vba excel macro with SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Run-a-vba-excel-macro-with-SAS/m-p/560739#M33747</link>
      <description>&lt;P&gt;Thank you for the reply!&lt;/P&gt;&lt;P&gt;I didn't&amp;nbsp;understand the log from the code submitted for XCMD... &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The log is:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;NOTE: Writing TAGSETS.SASREPORT13(EGSR) Body file: EGSR
21         
22         GOPTIONS ACCESSIBLE;
23         proc options
24         option=xcmd;
25         run;

    SAS (r) Proprietary Software Release 9.4  TS1M2

 XCMD              Enables the X command in SAS.
NOTE: PROCEDURE OPTIONS used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds
      

26         
27         GOPTIONS NOACCESSIBLE;
28         %LET _CLIENTTASKLABEL=;
29         %LET _CLIENTPROJECTPATH=;
30         %LET _CLIENTPROJECTNAME=;
31         %LET _SASPROGRAMFILE=;
32         
33         ;*';*";*/;quit;run;
34         ODS _ALL_ CLOSE;
35         
36         
37         QUIT; RUN;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;it's enable?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry!&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2019 08:33:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Run-a-vba-excel-macro-with-SAS/m-p/560739#M33747</guid>
      <dc:creator>FRAFLUTE</dc:creator>
      <dc:date>2019-05-22T08:33:49Z</dc:date>
    </item>
    <item>
      <title>Re: Run a vba excel macro with SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Run-a-vba-excel-macro-with-SAS/m-p/560866#M33758</link>
      <description>Yes it is. The second thing is to check that SAS runs locally or server and then if it runs locally, verify that your path to Excel is correct. It changes for each version of Excel.</description>
      <pubDate>Wed, 22 May 2019 14:54:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Run-a-vba-excel-macro-with-SAS/m-p/560866#M33758</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-05-22T14:54:05Z</dc:date>
    </item>
    <item>
      <title>Re: Run a vba excel macro with SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Run-a-vba-excel-macro-with-SAS/m-p/560888#M33759</link>
      <description>&lt;P&gt;Probably SAS run on server, because for starting the process we wait the connection to the server SAS App. It's possible?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Sorry for my ignorance and thank you for your support!&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2019 16:33:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Run-a-vba-excel-macro-with-SAS/m-p/560888#M33759</guid>
      <dc:creator>FRAFLUTE</dc:creator>
      <dc:date>2019-05-22T16:33:33Z</dc:date>
    </item>
    <item>
      <title>Re: Run a vba excel macro with SAS</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Run-a-vba-excel-macro-with-SAS/m-p/560892#M33760</link>
      <description>SAS needs to have access to the file and Excel, whether that's on a server or locally. You need to ensure you have both in the same place. If you don't you cannot do this. Some indications you may not be able to - you have to manually download the file from the server to work with it, you can't import files from your desktop using code.</description>
      <pubDate>Wed, 22 May 2019 16:54:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Run-a-vba-excel-macro-with-SAS/m-p/560892#M33760</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-05-22T16:54:02Z</dc:date>
    </item>
  </channel>
</rss>

