<?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: export to excel in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/export-to-excel/m-p/159965#M41685</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;IIt has only formatting and charts created that reference the data that is outfitted starting on cell a1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks v much!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 29 Mar 2014 19:25:59 GMT</pubDate>
    <dc:creator>hdg</dc:creator>
    <dc:date>2014-03-29T19:25:59Z</dc:date>
    <item>
      <title>export to excel</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/export-to-excel/m-p/159961#M41681</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi I have a quick question on exporting to excel&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I already have an existing template stored C:\temp\template.xlsx - having one sheet called 'Template'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have soem datasets of same columns that I want to export to this template&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Say I have a dataset called N1 and another dataset called N2 I would like to&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Creat an excel file called New which makes a copy of the tab 'Template'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) Outputs the dataset&amp;nbsp; N1 into New and renames the tab as N1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3) Do the same thing for the N2 dataset&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the end New should have two tabs N1 and N2 as the same format as the template file&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your help!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Mar 2014 15:35:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/export-to-excel/m-p/159961#M41681</guid>
      <dc:creator>hdg</dc:creator>
      <dc:date>2014-03-28T15:35:39Z</dc:date>
    </item>
    <item>
      <title>Re: export to excel</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/export-to-excel/m-p/159962#M41682</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I won't be able to look at this until later this afternoon but, if no one else has provided an answer by then, I will look at it.&amp;nbsp; Simple answer, yes, it probably can be done.&amp;nbsp; But I would need to know the answers to a few questions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what version of SAS are you using?&lt;/P&gt;&lt;P&gt;what operating system are you running on?&lt;/P&gt;&lt;P&gt;how big are the files (i.e., # of records and # of variables)?&lt;/P&gt;&lt;P&gt;do you need to copy the variable names or labels or neither?&lt;/P&gt;&lt;P&gt;should the data be copied starting at cell A1 or to a specific range?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Mar 2014 15:57:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/export-to-excel/m-p/159962#M41682</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2014-03-28T15:57:35Z</dc:date>
    </item>
    <item>
      <title>Re: export to excel</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/export-to-excel/m-p/159963#M41683</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks so much for your help Arthur.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is what you have asked.&lt;/P&gt;&lt;P&gt;I am using SAS 9.2 TS Level2M3 W32_VSPRO platform&lt;/P&gt;&lt;P&gt;OS Windows Version 6.1.7601&lt;/P&gt;&lt;P&gt;Number of records can vary [about 5000 rows] and columns are fixed [24 columns]&lt;/P&gt;&lt;P&gt;I would need to copy the column names - like the regular proc export command copies over the labels&lt;/P&gt;&lt;P&gt;starting at A1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is what I have been trying:a simple example just to copy the information in N1. This doesnt&amp;nbsp; work. This does not have the extra part where I am trying to have N2 as well copied in the same file..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;x to make a copy over the existing template&lt;/P&gt;&lt;P&gt;%let newfile=C:\temp\Template.xlsx;&lt;/P&gt;&lt;P&gt;%let newfiled = C:\temp\New.xlsx;&lt;/P&gt;&lt;P&gt;%let sheetName = N1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;options noxwait noxsync;&lt;/P&gt;&lt;P&gt;X copy "&amp;amp;newfile" "&amp;amp;newfiled" ;&lt;/P&gt;&lt;P&gt;proc export data= N1&amp;nbsp;&amp;nbsp; outfile="&amp;amp;newfiled"&amp;nbsp; dbms=EXCEL ;&amp;nbsp;&amp;nbsp;&amp;nbsp; sheet=&amp;amp;sheetName;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Mar 2014 16:06:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/export-to-excel/m-p/159963#M41683</guid>
      <dc:creator>hdg</dc:creator>
      <dc:date>2014-03-28T16:06:38Z</dc:date>
    </item>
    <item>
      <title>Re: export to excel</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/export-to-excel/m-p/159964#M41684</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think that I almost have an answer, but that depends on one more answer from you.&amp;nbsp; Does your template contain formulas or just formatting, highlighting and the like?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 29 Mar 2014 15:37:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/export-to-excel/m-p/159964#M41684</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2014-03-29T15:37:35Z</dc:date>
    </item>
    <item>
      <title>Re: export to excel</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/export-to-excel/m-p/159965#M41685</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;IIt has only formatting and charts created that reference the data that is outfitted starting on cell a1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks v much!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 29 Mar 2014 19:25:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/export-to-excel/m-p/159965#M41685</guid>
      <dc:creator>hdg</dc:creator>
      <dc:date>2014-03-29T19:25:59Z</dc:date>
    </item>
    <item>
      <title>Re: export to excel</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/export-to-excel/m-p/159966#M41686</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is the best I can do without charging you my exorbitant consulting fee and, even then, I'm probably too busy right now to even accept such a contract.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Tom Abernathy, FriedEgg and I just presented a paper, at SAS Global Forum, that provides a macro which has the capabilities needed to automate some aspects of what you are trying to accomplish.&amp;nbsp; That is, being able to modify an existing worksheet by pasting new data into it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just quickly wrote an additional macro that may be all that is needed to accomplish your current task.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Both macros, and a description of the original, can be found and downloaded at:&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sascommunity.org/wiki/A_Poor/Rich_SAS_Users_Proc_Export" title="http://www.sascommunity.org/wiki/A_Poor/Rich_SAS_Users_Proc_Export"&gt;A Poor/Rich SAS Users Proc Export - sasCommunity&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the code I just ran to test the combination of the two macros.&amp;nbsp; It assumes I have a file called "d:\art\template.xlsx" that has one worksheet called "Template" and that I want to use all of the formatting, etc. in that template, twice, to create a new Workbook called "d:\art\tclass.xlsx" that will have two worksheets called "N1" and "N2".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First, I create the datasets that I want to use to populate the new workbook:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sort data=sashelp.class out=class1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by name;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sort data=sashelp.class out=class2;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by descending name;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, I ran the following to create the new Workbook.&amp;nbsp; Basically, it copies the range (from A1 thru E21) from the Template worksheet in d:\art\template.xlsx TO a new worksheet (N1) in a new Workbook (:d:\art\tclass.xlsx &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%copytemplate(template=d:\art\template.xlsx,&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; templatesheet=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;&amp;nbsp;&amp;nbsp;&amp;nbsp; range=A1:E21,&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; outfile=d:\art\tclass.xlsx,&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; sheet=N1,&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; type=N)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, the following code is run to copy the N1 worksheet to a new worksheet called N2:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%copytemplate(template=d:\art\tclass.xlsx,&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; templatesheet=N1,&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; range=A1:E21,&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; outfile=d:\art\tclass.xlsx,&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; sheet=N2,&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;&amp;nbsp;&amp;nbsp;&amp;nbsp; type=A)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, the following code is run to copy class1 to the N1 Worksheet:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%exportxl(data=class1,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outfile=d:\art\tclass.xlsx,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sheet=N1,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; type=M,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; usenames=Y,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; range=A1,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; replace=Y)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And, finally, the following code is run to copy class2 to the N2 Worksheet:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%exportxl(data=class2,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; outfile=d:\art\tclass.xlsx,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sheet=N2,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; type=M,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; usenames=Y,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; range=A1,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; replace=Y)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above method will copy everything (graphs, formulas, and formatting) from the template to both of the new worksheets.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The only thing I wasn't able to get it to do was correctly populate the graphs, as they copy with absolute reference to the original worksheet (i.e., template).&amp;nbsp; If you, or anyone, knows how to get around that limitation (regarding charts), I'd be glad to incorporate it into the code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Art&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 29 Mar 2014 22:43:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/export-to-excel/m-p/159966#M41686</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2014-03-29T22:43:53Z</dc:date>
    </item>
    <item>
      <title>Re: export to excel</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/export-to-excel/m-p/159967#M41687</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Art. really appreciate your kind help on this. Will work on this tomorrow and let you know how it works out. thanks for the note as well. Heena&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 29 Mar 2014 23:53:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/export-to-excel/m-p/159967#M41687</guid>
      <dc:creator>hdg</dc:creator>
      <dc:date>2014-03-29T23:53:40Z</dc:date>
    </item>
    <item>
      <title>Re: export to excel</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/export-to-excel/m-p/159968#M41688</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;While I already posted a partial solution, I think I have figured out a way to do it that will keep all graphs and formatting.&amp;nbsp; I'll let you know as soon as I've written and tested it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Mar 2014 16:21:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/export-to-excel/m-p/159968#M41688</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2014-03-30T16:21:28Z</dc:date>
    </item>
    <item>
      <title>Re: export to excel</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/export-to-excel/m-p/159969#M41689</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If N1/N2 will always be the same table length then Link the graphs/formatting to two named ranges, N1 and N2. &lt;/P&gt;&lt;P&gt;SAS can export to the named ranges directly, and then the charts/format will be updated with the new data&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Mar 2014 17:38:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/export-to-excel/m-p/159969#M41689</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2014-03-30T17:38:24Z</dc:date>
    </item>
    <item>
      <title>Re: export to excel</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/export-to-excel/m-p/159970#M41690</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I ended up modifying the original exportxl macro which can be downloaded from:&lt;/P&gt;&lt;P&gt;&lt;A class="active_link" href="http://www.sascommunity.org/wiki/A_Poor/Rich_SAS_Users_Proc_Export" style="font-size: 10pt; line-height: 1.5em;" title="http://www.sascommunity.org/wiki/A_Poor/Rich_SAS_Users_Proc_Export"&gt;A Poor/Rich SAS Users Proc Export - sasCommunity&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To accomplish what you want to do, save your template as an Excel template.&amp;nbsp; I saved mine as d:\art\template.xltx).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, to test the idea, I created two sasfiles:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;proc sort data=sashelp.class out=class1;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; by name;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;proc sort data=sashelp.class out=class2;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp; by descending name;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;run;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Then, to create a new workbook, called d:\art\tclass.xlsx, using sheet Template in d:\art\template.xltx and adding the data from class1 into a sheet called N1, I submitted the following call of the macro:&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P&gt;%exportxl(data=class1,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; template=d:\art\template.xltx,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; templatesheet=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; outfile=d:\art\tclass.xlsx,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sheet=N1,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; type=N,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; usenames=Y,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; range=A1,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; replace=Y)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Finally, to add class2 to the &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;d:\art\tclass.xlsx&lt;/SPAN&gt; workbook as sheet N2, again using the Template worksheet in d:\art\template.xltx, I submitted the following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%exportxl(data=class2,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; template=d:\art\template.xltx,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; templatesheet=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; outfile=d:\art\tclass.xlsx,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sheet=N2,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; type=A,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; usenames=Y,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; range=A1,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; replace=Y)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope to update the documentation to explain the new named parameters, and how the code works, later this week.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The critical new parameters are: template, templatesheet, Type should be set to equal N to create a new workbook, and to A to add a new worksheet to an existing workbook.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Art&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Mar 2014 01:30:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/export-to-excel/m-p/159970#M41690</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2014-03-31T01:30:34Z</dc:date>
    </item>
    <item>
      <title>Re: export to excel</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/export-to-excel/m-p/159971#M41691</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Arthur, Just wanted to let you know the exportxl macro is awesome! Thanks soooo much for your help. You are amazing! Heena&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 May 2014 04:12:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/export-to-excel/m-p/159971#M41691</guid>
      <dc:creator>hdg</dc:creator>
      <dc:date>2014-05-17T04:12:41Z</dc:date>
    </item>
    <item>
      <title>Re: export to excel</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/export-to-excel/m-p/159972#M41692</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Glad to hear that it worked out.&amp;nbsp; And thank you for giving my colleagues and me good ideas for improving the utility of the macro.&amp;nbsp; BTW, you might want to mark this question as "answered" so that others don't spend any unnecessary time trying to come up with solutions (unless, of course, they have a better solution that hasn't yet been proposed).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 17 May 2014 21:58:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/export-to-excel/m-p/159972#M41692</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2014-05-17T21:58:56Z</dc:date>
    </item>
  </channel>
</rss>

