<?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: Need to run excel vba macros from windows command line in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Need-to-run-excel-vba-macros-from-windows-command-line/m-p/150805#M262460</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You would need to investigate VB scripting.&amp;nbsp; In your VB script you would need to open an office object.&amp;nbsp; Then you can use that object to execute various things which would normally be done within Office applications.&lt;/P&gt;&lt;P&gt;Here are some links to help you however this is out of scope of a SAS forum:&lt;/P&gt;&lt;P&gt;&lt;A class="active_link" href="http://www.pcreview.co.uk/forums/opening-excel-spreadsheet-within-vbscript-t965331.html"&gt;http://www.pcreview.co.uk/forums/opening-excel-spreadsheet-within-vbscript-t965331.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="active_link" href="http://answers.microsoft.com/en-us/office/forum/office_2010-customize/excel-fails-to-open-in-vbscript-with-createobject/e4086fb2-8ddc-4bc0-b2ae-cbf3800e0e82"&gt;http://answers.microsoft.com/en-us/office/forum/office_2010-customize/excel-fails-to-open-in-vbscript-with-createobject/e4086fb2-8ddc-4bc0-b2ae-cbf3800e0e82&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or from Visual Basic app:&lt;/P&gt;&lt;P&gt;&lt;A href="https://support.microsoft.com/kb/219151?wa=wsignin1.0" title="https://support.microsoft.com/kb/219151?wa=wsignin1.0"&gt;https://support.microsoft.com/kb/219151?wa=wsignin1.0&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.thescarms.com/vbasic/ExcelExport.aspx"&gt;http://www.thescarms.com/vbasic/ExcelExport.aspx&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 03 Feb 2015 14:31:29 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2015-02-03T14:31:29Z</dc:date>
    <item>
      <title>Need to run excel vba macros from windows command line</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-run-excel-vba-macros-from-windows-command-line/m-p/150803#M262458</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to automate the steps of process flow which includes SAS and SAS EG tasks(plug-ins) and Excel VBA macros.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here i would need help to understand how to run&amp;nbsp; a macro which is located in&amp;nbsp; excel file.&lt;/P&gt;&lt;P&gt;Example: sample.xlsm file&amp;nbsp; has the&amp;nbsp; macro with the name 'my_macro' .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would need to run this in windows command line by using .bat file.&lt;/P&gt;&lt;P&gt;I have done some googling I could not find proper solution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank You,&lt;/P&gt;&lt;P&gt;Durga.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2015 13:59:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-run-excel-vba-macros-from-windows-command-line/m-p/150803#M262458</guid>
      <dc:creator>dprasa8</dc:creator>
      <dc:date>2015-02-03T13:59:01Z</dc:date>
    </item>
    <item>
      <title>Re: Need to run excel vba macros from windows command line</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-run-excel-vba-macros-from-windows-command-line/m-p/150804#M262459</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Proceed as for example described here: &lt;A href="http://www.lexjansen.com/pharmasug/2005/CodersCorner/cc21.pdf"&gt;http://www.lexjansen.com/pharmasug/2005/CodersCorner/cc21.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your code could look like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Options XSync;&lt;/P&gt;&lt;P&gt;Data _NULL_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; rc=System('Start Excel');&lt;/P&gt;&lt;P&gt;&amp;nbsp; x=sleep(3);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;Filename EXCEL DDE 'EXCEL|SYSTEM';&lt;/P&gt;&lt;P&gt;Data _NULL_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; File EXCEL;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Put '[Open("&amp;lt;Path&amp;gt;\sample.xlsm")]';&lt;/P&gt;&lt;P&gt;&amp;nbsp; Put '[Run("My_Macro")]';&lt;/P&gt;&lt;P&gt;&amp;nbsp; Put '[Quit()]';&lt;/P&gt;&lt;P&gt;Run;&lt;/P&gt;&lt;P&gt;Filename EXCEL Clear;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2015 14:29:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-run-excel-vba-macros-from-windows-command-line/m-p/150804#M262459</guid>
      <dc:creator>user24feb</dc:creator>
      <dc:date>2015-02-03T14:29:42Z</dc:date>
    </item>
    <item>
      <title>Re: Need to run excel vba macros from windows command line</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-run-excel-vba-macros-from-windows-command-line/m-p/150805#M262460</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You would need to investigate VB scripting.&amp;nbsp; In your VB script you would need to open an office object.&amp;nbsp; Then you can use that object to execute various things which would normally be done within Office applications.&lt;/P&gt;&lt;P&gt;Here are some links to help you however this is out of scope of a SAS forum:&lt;/P&gt;&lt;P&gt;&lt;A class="active_link" href="http://www.pcreview.co.uk/forums/opening-excel-spreadsheet-within-vbscript-t965331.html"&gt;http://www.pcreview.co.uk/forums/opening-excel-spreadsheet-within-vbscript-t965331.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="active_link" href="http://answers.microsoft.com/en-us/office/forum/office_2010-customize/excel-fails-to-open-in-vbscript-with-createobject/e4086fb2-8ddc-4bc0-b2ae-cbf3800e0e82"&gt;http://answers.microsoft.com/en-us/office/forum/office_2010-customize/excel-fails-to-open-in-vbscript-with-createobject/e4086fb2-8ddc-4bc0-b2ae-cbf3800e0e82&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or from Visual Basic app:&lt;/P&gt;&lt;P&gt;&lt;A href="https://support.microsoft.com/kb/219151?wa=wsignin1.0" title="https://support.microsoft.com/kb/219151?wa=wsignin1.0"&gt;https://support.microsoft.com/kb/219151?wa=wsignin1.0&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.thescarms.com/vbasic/ExcelExport.aspx"&gt;http://www.thescarms.com/vbasic/ExcelExport.aspx&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2015 14:31:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-run-excel-vba-macros-from-windows-command-line/m-p/150805#M262460</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-02-03T14:31:29Z</dc:date>
    </item>
    <item>
      <title>Re: Need to run excel vba macros from windows command line</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-run-excel-vba-macros-from-windows-command-line/m-p/150806#M262461</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do be aware though, user24feb, DDE is old technology, no longer supported by M$.&amp;nbsp; It may/may not work in future, and wouldn't have all the functionality of later (at least 2007/2013 version) releases.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2015 14:33:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-run-excel-vba-macros-from-windows-command-line/m-p/150806#M262461</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-02-03T14:33:37Z</dc:date>
    </item>
    <item>
      <title>Re: Need to run excel vba macros from windows command line</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-to-run-excel-vba-macros-from-windows-command-line/m-p/150807#M262462</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;My organization has identified at least one application, Cisco Jabber, that will interfere with SAS DDE connections to Excel and other "legacy" software. This can be worked around by killing the process using Task Manager (closing the application leaves a process running). I wouldn't be surprised to find other applications that do the same.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Feb 2015 15:39:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-to-run-excel-vba-macros-from-windows-command-line/m-p/150807#M262462</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-02-03T15:39:02Z</dc:date>
    </item>
  </channel>
</rss>

