<?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: Excel automation in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Excel-automation/m-p/485888#M31479</link>
    <description>&lt;P&gt;See page 15 on the PDF linked above for an example of exporting data using the libname method.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The process for any of this is relatively simple though - break it down into small enough steps and then tackle each step independently.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You'll move faster with this type of approach.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The calculations don't sound cumbersome so it may be worth pushing it all to SAS. It seems this is beyond your skill set at the moment so you have 3 options:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Learn how to do it - takes time&lt;/P&gt;
&lt;P&gt;2. Pay someone else - takes money&lt;/P&gt;
&lt;P&gt;3. Find an alternative/mixed approach - suggestions above are that.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can search any topic on lexjansen.com. For example:&lt;/P&gt;
&lt;P&gt;How to email a report:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/resources/papers/proceedings17/1300-2017.pdf" target="_blank"&gt;http://support.sas.com/resources/papers/proceedings17/1300-2017.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The VBS and Excel VB macro code are also in the original PDF linked in my previous response. Maybe I'll write it up someday fully. The slides were for a presentation but without me talking they're less useful &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 10 Aug 2018 17:41:26 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2018-08-10T17:41:26Z</dc:date>
    <item>
      <title>Excel automation</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Excel-automation/m-p/485844#M31476</link>
      <description>&lt;P&gt;Hi Everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need some help to automate my excel work:&lt;/P&gt;&lt;P&gt;I will explain what I do currently..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;SAS CODE(&lt;/STRONG&gt;run as a trigger run)&lt;/P&gt;&lt;P&gt;SAS code which generates a table which I export in Excel(lets call it Data Sheet).&lt;/P&gt;&lt;P&gt;This has numbers for Prior month and current month to date(by date) for revenue.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;EXCEL WORK:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Excel workbook Report has sheets Sheet1 and Dsiplay1&lt;/P&gt;&lt;P&gt;I copy and paste data from Data Sheet and paste it in Sheet1.&lt;/P&gt;&lt;P&gt;Excel sheet Display1 has formulas which take data from Sheet1. I convert Display1 excel sheet as pdf and send it via email.&lt;/P&gt;&lt;P&gt;Once the data comes in for a day’s revenue, I have to freeze it which means I manually copy and paste the data for that day as a value in my excel(Display1 Sheet)…Numbers for Prior days will change when pulled on future date but we want to see the number as it first appeared on that day…&lt;/P&gt;&lt;P&gt;Eg, when I do a pull on 8th july, I get the below numbers:&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;01Jul2018&lt;/TD&gt;&lt;TD&gt;90&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;02Jul2018&lt;/TD&gt;&lt;TD&gt;123&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;03Jul2018&lt;/TD&gt;&lt;TD&gt;256&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;04Jul2018&lt;/TD&gt;&lt;TD&gt;123&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;05Jul2018&lt;/TD&gt;&lt;TD&gt;256&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;06Jul2018&lt;/TD&gt;&lt;TD&gt;548&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;07Jul2018&lt;/TD&gt;&lt;TD&gt;567&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;08Jul2018&lt;/TD&gt;&lt;TD&gt;400&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Now when I do a pull on 9th July I might get :&lt;/P&gt;&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;01Jul2018&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;02Jul2018&lt;/TD&gt;&lt;TD&gt;150&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;03Jul2018&lt;/TD&gt;&lt;TD&gt;200&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;04Jul2018&lt;/TD&gt;&lt;TD&gt;250&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;05Jul2018&lt;/TD&gt;&lt;TD&gt;300&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;06Jul2018&lt;/TD&gt;&lt;TD&gt;350&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;07Jul2018&lt;/TD&gt;&lt;TD&gt;400&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;08Jul2018&lt;/TD&gt;&lt;TD&gt;450&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;But in my report, I do want to see 7th July as it was pulled on 8th (567) not&amp;nbsp;400 and so forth for the coming days…&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My current code runs through a trigger run everyday at 5am , so when I come to office I have the data ready and do the Excel work..What I want to do is to automate the excel work as well so I do not have to work on it everyday..the mail automatically gets out!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this isn't the right spot for such a question, please direct me to the appropriate forum.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot!! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Aug 2018 16:16:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Excel-automation/m-p/485844#M31476</guid>
      <dc:creator>new_sas_user_4</dc:creator>
      <dc:date>2018-08-10T16:16:24Z</dc:date>
    </item>
    <item>
      <title>Re: Excel automation</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Excel-automation/m-p/485854#M31477</link>
      <description>&lt;P&gt;This is the right place but your question is a bit too vague to offer a full solution. I can say that all of this can be done with SAS since I've done it multiple times. Out of curiousity, is there any reason you couldn't generate the full report in SAS outputted to a PDF report and then email that PDF? That's likely the easiest solution depending on the complexity of your data process/report.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As an interim:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Create an Excel template with the formulas you want. In template, create a named range large enough to hold all of your data. It can be bigger but if it's smaller you'll get errors. Make the template also have an excel macro that will export to a &amp;nbsp;specific location with a fixed or dynamic file name as needed. Sometimes I create a new named range that will contain the file name and location.&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;Export data to named range. Use the libname method here.&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;Look into either DDE or VBS, I recommend VBS to run the macro in the workbook to create the PDF&lt;/LI&gt;
&lt;LI&gt;Use SAS to call the VBS and to email as necessary.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;I still think redesigning your process in SAS fully is likely to be easier.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Don't know if this has enough details but this is a walkthrough of how I did it:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.sas.com/content/dam/SAS/en_ca/User%20Group%20Presentations/Edmonton-User-Group/FareezaKhurshed-CoordinateComplexReports-Spring2014.pdf" target="_blank"&gt;https://www.sas.com/content/dam/SAS/en_ca/User%20Group%20Presentations/Edmonton-User-Group/FareezaKhurshed-CoordinateComplexReports-Spring2014.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/213838"&gt;@new_sas_user_4&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi Everyone,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I need some help to automate my excel work:&lt;/P&gt;
&lt;P&gt;I will explain what I do currently..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;SAS CODE(&lt;/STRONG&gt;run as a trigger run)&lt;/P&gt;
&lt;P&gt;SAS code which generates a table which I export in Excel(lets call it Data Sheet).&lt;/P&gt;
&lt;P&gt;This has numbers for Prior month and current month to date(by date) for revenue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;EXCEL WORK:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Excel workbook Report has sheets Sheet1 and Dsiplay1&lt;/P&gt;
&lt;P&gt;I copy and paste data from Data Sheet and paste it in Sheet1.&lt;/P&gt;
&lt;P&gt;Excel sheet Display1 has formulas which take data from Sheet1. I convert Display1 excel sheet as pdf and send it via email.&lt;/P&gt;
&lt;P&gt;Once the data comes in for a day’s revenue, I have to freeze it which means I manually copy and paste the data for that day as a value in my excel(Display1 Sheet)…Numbers for Prior days will change when pulled on future date but we want to see the number as it first appeared on that day…&lt;/P&gt;
&lt;P&gt;Eg, when I do a pull on 8th july, I get the below numbers:&lt;/P&gt;
&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;01Jul2018&lt;/TD&gt;
&lt;TD&gt;90&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;02Jul2018&lt;/TD&gt;
&lt;TD&gt;123&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;03Jul2018&lt;/TD&gt;
&lt;TD&gt;256&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;04Jul2018&lt;/TD&gt;
&lt;TD&gt;123&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;05Jul2018&lt;/TD&gt;
&lt;TD&gt;256&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;06Jul2018&lt;/TD&gt;
&lt;TD&gt;548&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;07Jul2018&lt;/TD&gt;
&lt;TD&gt;567&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;08Jul2018&lt;/TD&gt;
&lt;TD&gt;400&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;Now when I do a pull on 9th July I might get :&lt;/P&gt;
&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;01Jul2018&lt;/TD&gt;
&lt;TD&gt;100&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;02Jul2018&lt;/TD&gt;
&lt;TD&gt;150&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;03Jul2018&lt;/TD&gt;
&lt;TD&gt;200&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;04Jul2018&lt;/TD&gt;
&lt;TD&gt;250&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;05Jul2018&lt;/TD&gt;
&lt;TD&gt;300&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;06Jul2018&lt;/TD&gt;
&lt;TD&gt;350&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;07Jul2018&lt;/TD&gt;
&lt;TD&gt;400&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;08Jul2018&lt;/TD&gt;
&lt;TD&gt;450&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&lt;BR /&gt;&amp;nbsp;But in my report, I do want to see 7th July as it was pulled on 8th (567) not&amp;nbsp;400 and so forth for the coming days…&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My current code runs through a trigger run everyday at 5am , so when I come to office I have the data ready and do the Excel work..What I want to do is to automate the excel work as well so I do not have to work on it everyday..the mail automatically gets out!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this isn't the right spot for such a question, please direct me to the appropriate forum.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks a lot!! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Aug 2018 16:44:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Excel-automation/m-p/485854#M31477</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-08-10T16:44:55Z</dc:date>
    </item>
    <item>
      <title>Re: Excel automation</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Excel-automation/m-p/485883#M31478</link>
      <description>&lt;P&gt;Thanks Reeza!!&lt;/P&gt;&lt;P&gt;One of the&amp;nbsp;&lt;SPAN&gt;reasons I couldn't&amp;nbsp; do this is :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;There is data (such as revenue target for each day fixed one time at start of the month) &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;which needs to be a column in the final display ...also a column which has variance(difference) between actuals (what I pull each day) and the target....and a few other columns some of which are fixed data and some dynamic or manually calculated..&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;and the other reason: I do not know the process to&amp;nbsp;generate the full report in SAS outputted to a PDF report and then email that PDF..&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Could you please elaborate on he interim solution you suggested..I didnt understand steps 2,3,4...using libname and thereafter..I do not use excel macros as of now..&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;also, if there is any link or site to learn how to do it, please direct me there...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am new to using SAS or excel macros and automation...&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Aug 2018 17:27:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Excel-automation/m-p/485883#M31478</guid>
      <dc:creator>new_sas_user_4</dc:creator>
      <dc:date>2018-08-10T17:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: Excel automation</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Excel-automation/m-p/485888#M31479</link>
      <description>&lt;P&gt;See page 15 on the PDF linked above for an example of exporting data using the libname method.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The process for any of this is relatively simple though - break it down into small enough steps and then tackle each step independently.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You'll move faster with this type of approach.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The calculations don't sound cumbersome so it may be worth pushing it all to SAS. It seems this is beyond your skill set at the moment so you have 3 options:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. Learn how to do it - takes time&lt;/P&gt;
&lt;P&gt;2. Pay someone else - takes money&lt;/P&gt;
&lt;P&gt;3. Find an alternative/mixed approach - suggestions above are that.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can search any topic on lexjansen.com. For example:&lt;/P&gt;
&lt;P&gt;How to email a report:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/resources/papers/proceedings17/1300-2017.pdf" target="_blank"&gt;http://support.sas.com/resources/papers/proceedings17/1300-2017.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The VBS and Excel VB macro code are also in the original PDF linked in my previous response. Maybe I'll write it up someday fully. The slides were for a presentation but without me talking they're less useful &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Aug 2018 17:41:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Excel-automation/m-p/485888#M31479</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-08-10T17:41:26Z</dc:date>
    </item>
  </channel>
</rss>

