<?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 how to execute a Excel VBA using SAS EG 8.3 in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-execute-a-Excel-VBA-using-SAS-EG-8-3/m-p/871099#M42770</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to execute an Excel VBA using SAS EG 8.3.&amp;nbsp; Excel is hosted on my c drive while the Excel file itself is hosted on a window server.&amp;nbsp; SAS .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's my sript , follow by the log file.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options noxwait noxsync;
x '"C:\Program Files\Microsoft Office\root\Office16\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("P:\Temp\TestStephane.xlsm")]';
/* Run myVBAmacro */
put '[run("TestStephane.xlsm!genereGus")]';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;NOTE: Writing HTML5(EGHTML) Body file: EGHTML&lt;BR /&gt;28 &lt;BR /&gt;29 options noxwait noxsync;&lt;BR /&gt;_______&lt;BR /&gt;13&lt;BR /&gt;ERROR 13-12: Unrecognized SAS option name NOXWAIT.&lt;/P&gt;
&lt;P&gt;29 ! options noxwait noxsync;&lt;BR /&gt;_______&lt;BR /&gt;13&lt;BR /&gt;ERROR 13-12: Unrecognized SAS option name NOXSYNC.&lt;/P&gt;
&lt;P&gt;30 x '"C:\Program Files\Microsoft Office\root\Office16\EXCEL.EXE" '&lt;BR /&gt;30 ! ;&lt;BR /&gt;31 /* Sleep for 5 seconds to give Excel time to come up */&lt;BR /&gt;32 data _null_;&lt;BR /&gt;33 x=sleep(5);&lt;BR /&gt;34 run;&lt;/P&gt;
&lt;P&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;/P&gt;
&lt;P&gt;35 filename cmds dde "excel|system";&lt;BR /&gt;ERROR: Invalid device type.&lt;BR /&gt;ERROR: Error in the FILENAME statement.&lt;BR /&gt;36 &lt;BR /&gt;37 data _null_;&lt;BR /&gt;38 file cmds;&lt;BR /&gt;39 /* Open the excel file test.xlsm which contains the VBA macro */&lt;BR /&gt;2 The SAS System 09:11 Thursday, April 20, 2023&lt;/P&gt;
&lt;P&gt;40 put '[open("P:\Temp\TestStephane.xlsm")]';&lt;BR /&gt;41 /* Run myVBAmacro */&lt;BR /&gt;42 put '[run("TestStephane.xlsm!genereGus")]';&lt;BR /&gt;43 run;&lt;/P&gt;
&lt;P&gt;ERROR: Insufficient authorization to access /opt/sas94/Config/Lev1/SASApp/cmds.dat.&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;BR /&gt;***********&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One more question.&amp;nbsp; How do you close the excel file ? Does this command will work ?&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;put '[close("P:\Temp\TestStephane.xlsm")]';&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 21 Apr 2023 12:56:53 GMT</pubDate>
    <dc:creator>alepage</dc:creator>
    <dc:date>2023-04-21T12:56:53Z</dc:date>
    <item>
      <title>how to execute a Excel VBA using SAS EG 8.3</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-execute-a-Excel-VBA-using-SAS-EG-8-3/m-p/871099#M42770</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to execute an Excel VBA using SAS EG 8.3.&amp;nbsp; Excel is hosted on my c drive while the Excel file itself is hosted on a window server.&amp;nbsp; SAS .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's my sript , follow by the log file.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options noxwait noxsync;
x '"C:\Program Files\Microsoft Office\root\Office16\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("P:\Temp\TestStephane.xlsm")]';
/* Run myVBAmacro */
put '[run("TestStephane.xlsm!genereGus")]';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;NOTE: Writing HTML5(EGHTML) Body file: EGHTML&lt;BR /&gt;28 &lt;BR /&gt;29 options noxwait noxsync;&lt;BR /&gt;_______&lt;BR /&gt;13&lt;BR /&gt;ERROR 13-12: Unrecognized SAS option name NOXWAIT.&lt;/P&gt;
&lt;P&gt;29 ! options noxwait noxsync;&lt;BR /&gt;_______&lt;BR /&gt;13&lt;BR /&gt;ERROR 13-12: Unrecognized SAS option name NOXSYNC.&lt;/P&gt;
&lt;P&gt;30 x '"C:\Program Files\Microsoft Office\root\Office16\EXCEL.EXE" '&lt;BR /&gt;30 ! ;&lt;BR /&gt;31 /* Sleep for 5 seconds to give Excel time to come up */&lt;BR /&gt;32 data _null_;&lt;BR /&gt;33 x=sleep(5);&lt;BR /&gt;34 run;&lt;/P&gt;
&lt;P&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;/P&gt;
&lt;P&gt;35 filename cmds dde "excel|system";&lt;BR /&gt;ERROR: Invalid device type.&lt;BR /&gt;ERROR: Error in the FILENAME statement.&lt;BR /&gt;36 &lt;BR /&gt;37 data _null_;&lt;BR /&gt;38 file cmds;&lt;BR /&gt;39 /* Open the excel file test.xlsm which contains the VBA macro */&lt;BR /&gt;2 The SAS System 09:11 Thursday, April 20, 2023&lt;/P&gt;
&lt;P&gt;40 put '[open("P:\Temp\TestStephane.xlsm")]';&lt;BR /&gt;41 /* Run myVBAmacro */&lt;BR /&gt;42 put '[run("TestStephane.xlsm!genereGus")]';&lt;BR /&gt;43 run;&lt;/P&gt;
&lt;P&gt;ERROR: Insufficient authorization to access /opt/sas94/Config/Lev1/SASApp/cmds.dat.&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt;real time 0.00 seconds&lt;BR /&gt;cpu time 0.00 seconds&lt;BR /&gt;***********&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One more question.&amp;nbsp; How do you close the excel file ? Does this command will work ?&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;put '[close("P:\Temp\TestStephane.xlsm")]';&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2023 12:56:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-execute-a-Excel-VBA-using-SAS-EG-8-3/m-p/871099#M42770</guid>
      <dc:creator>alepage</dc:creator>
      <dc:date>2023-04-21T12:56:53Z</dc:date>
    </item>
    <item>
      <title>Re: how to execute a Excel VBA using SAS EG 8.3</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-execute-a-Excel-VBA-using-SAS-EG-8-3/m-p/871107#M42771</link>
      <description>&lt;P&gt;you are trying to to run local excel&amp;nbsp;&lt;/P&gt;
&lt;PRE class="language-sas"&gt;&lt;CODE&gt;"C:\Program Files\Microsoft Office\root\Office16\EXCEL.EXE&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;on remote SAS server:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;/opt/sas94/Config/Lev1/SASApp/&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;no way it will happen...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Bart&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2023 13:03:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-execute-a-Excel-VBA-using-SAS-EG-8-3/m-p/871107#M42771</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2023-04-21T13:03:05Z</dc:date>
    </item>
    <item>
      <title>Re: how to execute a Excel VBA using SAS EG 8.3</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-execute-a-Excel-VBA-using-SAS-EG-8-3/m-p/871117#M42772</link>
      <description>First of all, Bart is correct. Secondly, executing VBA on a server (even if the file is moved) is going to be very, very problematic. Not worth it. Hence, I suggest abandoning your VBA plans.&lt;BR /&gt;&lt;BR /&gt;So, what are the alternatives? VBA should be reserved for interactive work, not file work. VBA is not recommended, regardless, and professional shops use VSTO for anything serious.&lt;BR /&gt;&lt;BR /&gt; If the goal is to change something in the file, use a file manipulation technique. I use C# and GemBox but you can also use Excel interop. Python has something similar. &lt;BR /&gt;&lt;BR /&gt;DDE is mis-spelled. It should be DEAD &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; Seriously, dont ever use it.</description>
      <pubDate>Fri, 21 Apr 2023 13:21:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-execute-a-Excel-VBA-using-SAS-EG-8-3/m-p/871117#M42772</guid>
      <dc:creator>AlanC</dc:creator>
      <dc:date>2023-04-21T13:21:09Z</dc:date>
    </item>
    <item>
      <title>Re: how to execute a Excel VBA using SAS EG 8.3</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-execute-a-Excel-VBA-using-SAS-EG-8-3/m-p/873059#M42817</link>
      <description>&lt;P&gt;Hello &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/76331"&gt;@alepage&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;In order to run excel vba using SAS EG is that SAS Should be installed on a Windows machine and excel should be installed on the same machine&amp;nbsp; and users have the necessary permissions.&lt;BR /&gt;From the log it appears that SAS is running on a Linux/Unix server. So what you want is not a feasible preposition.&lt;/P&gt;</description>
      <pubDate>Sun, 30 Apr 2023 14:35:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/how-to-execute-a-Excel-VBA-using-SAS-EG-8-3/m-p/873059#M42817</guid>
      <dc:creator>Sajid01</dc:creator>
      <dc:date>2023-04-30T14:35:01Z</dc:date>
    </item>
  </channel>
</rss>

