<?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: Update a given excel sheet with new data in Microsoft Integration with SAS</title>
    <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Update-a-given-excel-sheet-with-new-data/m-p/313713#M1971</link>
    <description>&lt;P&gt;Well, several points here. &amp;nbsp;First why do you need the Excel file if your using Word? &amp;nbsp;Secondly Office has VBA behind the scenes, dump the SAS data to CSV, then use VBA to import and process the data into either Word or Excel. &amp;nbsp;Finally, why bother using office at all, if you need to create reports then do it straight from SAS (HTML maybe?) or use a proper reporting environment. &amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 23 Nov 2016 09:09:46 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2016-11-23T09:09:46Z</dc:date>
    <item>
      <title>Update a given excel sheet with new data</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Update-a-given-excel-sheet-with-new-data/m-p/313617#M1965</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a worksheet that I need to update monthly in excel. The excel sheet is linked to a word document; thus updating the excel sheet also updates the table in my word document.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to use SAS to update the data in excel each month. The headings&amp;nbsp;always remain the same.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using SAS version 9.4. Is there a way of replacing the data on a given sheet? To clarify, I do NOT want to overwrite the entire workbook or append&amp;nbsp;data to a new sheet, as this will interfere with my ability to automatically update my word documents.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Nov 2016 22:54:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Update-a-given-excel-sheet-with-new-data/m-p/313617#M1965</guid>
      <dc:creator>azorachase</dc:creator>
      <dc:date>2016-11-22T22:54:37Z</dc:date>
    </item>
    <item>
      <title>Re: Update a given excel sheet with new data</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Update-a-given-excel-sheet-with-new-data/m-p/313620#M1966</link>
      <description>&lt;P&gt;Do you have the Add In for Microsoft Office?&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2016 00:01:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Update-a-given-excel-sheet-with-new-data/m-p/313620#M1966</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-11-23T00:01:37Z</dc:date>
    </item>
    <item>
      <title>Re: Update a given excel sheet with new data</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Update-a-given-excel-sheet-with-new-data/m-p/313621#M1967</link>
      <description>&lt;P&gt;Otherwise your best bet is to set up a named range in your excel sheet. Make sure it's large enough to hold all of your data.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then you can assign a libname to the workbook and drop and replace the information in place.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;untested:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;libname out xlsx 'path to xlsx file';&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;/P&gt;
&lt;P&gt;drop table named_range;&lt;/P&gt;
&lt;P&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data out.named_range;&lt;/P&gt;
&lt;P&gt;set new_data&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;libname out;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2016 00:03:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Update-a-given-excel-sheet-with-new-data/m-p/313621#M1967</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-11-23T00:03:11Z</dc:date>
    </item>
    <item>
      <title>Re: Update a given excel sheet with new data</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Update-a-given-excel-sheet-with-new-data/m-p/313634#M1968</link>
      <description>&lt;P&gt;This works for me:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Write new data to Excel workbook containing a 3-column named range called MyData */

/* Create some data (3 columns) */ 
data myDataUpdate;
do i = 1 to 10;
    x = i;
    y = i * i;
    z = i * i * i;
    output;
    end;
drop i;
run;

/* Connect to the workbook */
libname xl excel "&amp;amp;sasforum\datasets\myDataUpdate.xlsx";

proc sql;
/* Drop the contents of the named range */
drop table xl.MyData;
/* Write new content to the named range. 
 The number of rows in the named range will be adjusted  */
create table xl.MyData as
select * from myDataUpdate;
quit;

libname xl clear;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 23 Nov 2016 01:58:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Update-a-given-excel-sheet-with-new-data/m-p/313634#M1968</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-11-23T01:58:22Z</dc:date>
    </item>
    <item>
      <title>Re: Update a given excel sheet with new data</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Update-a-given-excel-sheet-with-new-data/m-p/313713#M1971</link>
      <description>&lt;P&gt;Well, several points here. &amp;nbsp;First why do you need the Excel file if your using Word? &amp;nbsp;Secondly Office has VBA behind the scenes, dump the SAS data to CSV, then use VBA to import and process the data into either Word or Excel. &amp;nbsp;Finally, why bother using office at all, if you need to create reports then do it straight from SAS (HTML maybe?) or use a proper reporting environment. &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Nov 2016 09:09:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Update-a-given-excel-sheet-with-new-data/m-p/313713#M1971</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-11-23T09:09:46Z</dc:date>
    </item>
    <item>
      <title>Re: Update a given excel sheet with new data</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Update-a-given-excel-sheet-with-new-data/m-p/314985#M1977</link>
      <description>&lt;P&gt;Brilliant, thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 22:17:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/Update-a-given-excel-sheet-with-new-data/m-p/314985#M1977</guid>
      <dc:creator>azorachase</dc:creator>
      <dc:date>2016-11-28T22:17:50Z</dc:date>
    </item>
  </channel>
</rss>

