<?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 VBA subroutine through SAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Run-VBA-subroutine-through-SAS/m-p/171576#M301524</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;file excel;&lt;/P&gt;&lt;P&gt;assigns an output file to the data step for a file reference of the name "excel".&lt;/P&gt;&lt;P&gt;Do you have a&lt;/P&gt;&lt;P&gt;filename excel ........;&lt;/P&gt;&lt;P&gt;somewhere before that in your code? If so, post it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 14 Nov 2014 08:08:52 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2014-11-14T08:08:52Z</dc:date>
    <item>
      <title>Run VBA subroutine through SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Run-VBA-subroutine-through-SAS/m-p/171575#M301523</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;BR /&gt; Please help me out ASAP.&lt;BR /&gt; I was trying to run a vba subroutine by writing code in SAS. I followed no. of ways and took help from diffrent blogs as poted by no. of peoples on diffrent site.&lt;BR /&gt;I saved and excel file including a macro function in .xlsm (book1) n tried to run this file using sas. code i wrote on sas :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;options xsync;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;file excel;&lt;/P&gt;&lt;P&gt;put&amp;nbsp; '[open("c:\book1.xlsm")]';&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;data _null_;&lt;/P&gt;&lt;P&gt;file excel;&lt;/P&gt;&lt;P&gt;put '[run("macro1")]';&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but this didnt work. my sas code didn't give error, instead of this it got hanged out.&lt;/P&gt;&lt;P&gt;Somehelp me out plz. so that i can run my code as much as possible and can represent to my client.&lt;/P&gt;&lt;P&gt;note: my vba code has no. of subroutine,i tried on a smalll macro to try this but didnt get result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Waiting for reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Mohit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Nov 2014 07:30:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Run-VBA-subroutine-through-SAS/m-p/171575#M301523</guid>
      <dc:creator>MohitMac</dc:creator>
      <dc:date>2014-11-14T07:30:54Z</dc:date>
    </item>
    <item>
      <title>Re: Run VBA subroutine through SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Run-VBA-subroutine-through-SAS/m-p/171576#M301524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;file excel;&lt;/P&gt;&lt;P&gt;assigns an output file to the data step for a file reference of the name "excel".&lt;/P&gt;&lt;P&gt;Do you have a&lt;/P&gt;&lt;P&gt;filename excel ........;&lt;/P&gt;&lt;P&gt;somewhere before that in your code? If so, post it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Nov 2014 08:08:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Run-VBA-subroutine-through-SAS/m-p/171576#M301524</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2014-11-14T08:08:52Z</dc:date>
    </item>
    <item>
      <title>Re: Run VBA subroutine through SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Run-VBA-subroutine-through-SAS/m-p/171577#M301525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kurt,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your valueable answer.&lt;/P&gt;&lt;P&gt;i declared this before running data step.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;options xsync;&lt;/P&gt;&lt;P&gt;filename EXCEL DDE 'EXCEL|SYSTEM';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and then run the data step .&lt;BR /&gt;when i m not declaring filename , sas executing the data step without any error, but affect on excel file, while i am using this "filename" statement sas got stucked for a long time for the same code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please let me know the step , which should i follow.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;Mohit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Nov 2014 08:30:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Run-VBA-subroutine-through-SAS/m-p/171577#M301525</guid>
      <dc:creator>MohitMac</dc:creator>
      <dc:date>2014-11-14T08:30:53Z</dc:date>
    </item>
    <item>
      <title>Re: Run VBA subroutine through SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Run-VBA-subroutine-through-SAS/m-p/171578#M301526</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;According to&lt;/P&gt;&lt;P&gt;&lt;A class="active_link" href="http://support.sas.com/documentation/cdl/en/hostwin/63285/HTML/default/viewer.htm#ddeexamples.htm" title="http://support.sas.com/documentation/cdl/en/hostwin/63285/HTML/default/viewer.htm#ddeexamples.htm"&gt;http://support.sas.com/documentation/cdl/en/hostwin/63285/HTML/default/viewer.htm#ddeexamples.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;you should explicitly specify noxsync and noxwait; also, did you open the DDE server by starting Excel first?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Nov 2014 08:39:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Run-VBA-subroutine-through-SAS/m-p/171578#M301526</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2014-11-14T08:39:13Z</dc:date>
    </item>
    <item>
      <title>Re: Run VBA subroutine through SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Run-VBA-subroutine-through-SAS/m-p/171579#M301527</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What exactly is it your trying to achieve by running a VBA macro from Excel?&amp;nbsp; IMO I would suggest that you go one of these routes:&lt;/P&gt;&lt;P&gt;- ODS tagsets.excelxp - unless there is something specific not in the tagset, this is the easiest.&lt;/P&gt;&lt;P&gt;- If there is something specific then:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - Create your spreadsheet as you would like it, with the macro in place.&amp;nbsp; Export your data from SAS as plain XLS file.&amp;nbsp; Now in your template&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; spreadsheet import that data across into your template spreadsheet.&amp;nbsp; This gives most flexibility as you can have VBA copy across and process&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; the data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - Create your spreadsheet as you would like it and create named ranges for where the data should go.&amp;nbsp; In SAS create a libname to the Excel file&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (example: &lt;A href="http://www2.sas.com/proceedings/sugi31/024-31.pdf" title="http://www2.sas.com/proceedings/sugi31/024-31.pdf"&gt;http://www2.sas.com/proceedings/sugi31/024-31.pdf&lt;/A&gt;) and copy your data into the libname.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; - A final possibility is to learn Open Office format.&amp;nbsp; XLSX is actually a ZIP file (change the extension) with some subdirectories and XML files&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; within it.&amp;nbsp; You can yourself create these XML files and structure in SAS with data and put statements if you know what you are doing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would not suggest using DDE as it may/may not be supported in future and due to it being written for and Excel from years ago doesn't have full functionality.&amp;nbsp; Plus if you have the script running in anything but locally installed with office then it will fail.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Nov 2014 09:37:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Run-VBA-subroutine-through-SAS/m-p/171579#M301527</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-11-14T09:37:50Z</dc:date>
    </item>
  </channel>
</rss>

