<?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: Assigning data to designated cells in Excel Spreadsheet in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Assigning-data-to-designated-cells-in-Excel-Spreadsheet/m-p/55452#M15434</link>
    <description>Hi.Just as Cynthia@SAS said ,you can do it by DDE.&lt;BR /&gt;
But firstly you should create a xls file(e.g Op.xls),and before run the code below,you should open Op.xls;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
filename area1 DDE 'excel|c:\[Op.xls]Sheet1!r2c2:r50c20';&lt;BR /&gt;
filename area2 DDE 'excel|c:\[Op.xls]Sheet1!r2c30:r50c40';&lt;BR /&gt;
&lt;BR /&gt;
data _null_;&lt;BR /&gt;
set sashelp.class;&lt;BR /&gt;
 file area1;&lt;BR /&gt;
 put name sex height weight;&lt;BR /&gt;
 file area2;&lt;BR /&gt;
 put name sex height weight;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
    <pubDate>Tue, 27 Jul 2010 08:51:44 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2010-07-27T08:51:44Z</dc:date>
    <item>
      <title>Assigning data to designated cells in Excel Spreadsheet</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Assigning-data-to-designated-cells-in-Excel-Spreadsheet/m-p/55450#M15432</link>
      <description>Hi All, &lt;BR /&gt;
&lt;BR /&gt;
I am not sure if SAS can do this. I would like to export data into an excel spreadsheet (I know this bit can be easily done) however, the hard bit is that I am hoping to assign the data to designated cells. say for example dataset A goes to Cell A2:O90 and dataset B does to B10:C30. &lt;BR /&gt;
&lt;BR /&gt;
Hoping someone can help me out on this one! &lt;BR /&gt;
&lt;BR /&gt;
Cheers!&lt;BR /&gt;
&lt;BR /&gt;
Message was edited by: Yennie

Message was edited by: Yennie</description>
      <pubDate>Mon, 26 Jul 2010 02:22:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Assigning-data-to-designated-cells-in-Excel-Spreadsheet/m-p/55450#M15432</guid>
      <dc:creator>Yennie</dc:creator>
      <dc:date>2010-07-26T02:22:56Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning data to designated cells in Excel Spreadsheet</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Assigning-data-to-designated-cells-in-Excel-Spreadsheet/m-p/55451#M15433</link>
      <description>Hi:&lt;BR /&gt;
  You can't write to explicit cell locations using the Output Delivery System methods. ODS wants to recreate the entire spreadsheet. However, you can write to named ranges in a sheet using the LIBNAME Excel engine and maybe with PROC IMPORT.&lt;BR /&gt;
 &lt;BR /&gt;
  The other alternative is to investigate the use of DDE or ODBC or OLE-DB.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Mon, 26 Jul 2010 05:19:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Assigning-data-to-designated-cells-in-Excel-Spreadsheet/m-p/55451#M15433</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-07-26T05:19:42Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning data to designated cells in Excel Spreadsheet</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Assigning-data-to-designated-cells-in-Excel-Spreadsheet/m-p/55452#M15434</link>
      <description>Hi.Just as Cynthia@SAS said ,you can do it by DDE.&lt;BR /&gt;
But firstly you should create a xls file(e.g Op.xls),and before run the code below,you should open Op.xls;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
filename area1 DDE 'excel|c:\[Op.xls]Sheet1!r2c2:r50c20';&lt;BR /&gt;
filename area2 DDE 'excel|c:\[Op.xls]Sheet1!r2c30:r50c40';&lt;BR /&gt;
&lt;BR /&gt;
data _null_;&lt;BR /&gt;
set sashelp.class;&lt;BR /&gt;
 file area1;&lt;BR /&gt;
 put name sex height weight;&lt;BR /&gt;
 file area2;&lt;BR /&gt;
 put name sex height weight;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
      <pubDate>Tue, 27 Jul 2010 08:51:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Assigning-data-to-designated-cells-in-Excel-Spreadsheet/m-p/55452#M15434</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2010-07-27T08:51:44Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning data to designated cells in Excel Spreadsheet</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Assigning-data-to-designated-cells-in-Excel-Spreadsheet/m-p/55453#M15435</link>
      <description>one interesting thing we used to do with DDE, took advantage of the FILEVAR= option on the FILE statement. &lt;BR /&gt;
The value of the FILEVAR was re-evaluated each time the code executed the FILE statement. That allowed the data step to write to any number of ranges with just the one file statement.&lt;BR /&gt;
There are other and stronger reasons for avoiding DDE.&lt;BR /&gt;
 &lt;BR /&gt;
peterC</description>
      <pubDate>Tue, 27 Jul 2010 13:04:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Assigning-data-to-designated-cells-in-Excel-Spreadsheet/m-p/55453#M15435</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2010-07-27T13:04:13Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning data to designated cells in Excel Spreadsheet</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Assigning-data-to-designated-cells-in-Excel-Spreadsheet/m-p/55454#M15436</link>
      <description>Hi.Peter.&lt;BR /&gt;
I have no clue about this ,Sorry. I just saw something writed by Cynthia and write these codes. You should talk with some technical guys of SAS.They can give some detailed reason. It is also not convenient to open xls file firstly with DDE.</description>
      <pubDate>Wed, 28 Jul 2010 09:15:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Assigning-data-to-designated-cells-in-Excel-Spreadsheet/m-p/55454#M15436</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2010-07-28T09:15:01Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning data to designated cells in Excel Spreadsheet</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Assigning-data-to-designated-cells-in-Excel-Spreadsheet/m-p/55455#M15437</link>
      <description>Hi:&lt;BR /&gt;
  There are many papers on DDE written by Koen Vyverman and they are very, very useful, if you are going to use DDE. &lt;BR /&gt;
                                          &lt;BR /&gt;
And if you Google for papers about SAS and DDE, in addition to the Vyverman papers, you will find this paper (by Cohen and Shields):&lt;BR /&gt;
 &lt;A href="http://www.nesug.org/proceedings/nesug04/hw/hw01.pdf" target="_blank"&gt;http://www.nesug.org/proceedings/nesug04/hw/hw01.pdf&lt;/A&gt;&lt;BR /&gt;
    &lt;BR /&gt;
In which they explain 2 ways to open Excel from within a SAS program.&lt;BR /&gt;
       &lt;BR /&gt;
cynthia</description>
      <pubDate>Wed, 28 Jul 2010 14:55:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Assigning-data-to-designated-cells-in-Excel-Spreadsheet/m-p/55455#M15437</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-07-28T14:55:19Z</dc:date>
    </item>
    <item>
      <title>Re: Assigning data to designated cells in Excel Spreadsheet</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Assigning-data-to-designated-cells-in-Excel-Spreadsheet/m-p/55456#M15438</link>
      <description>Hi.Cynthia.&lt;BR /&gt;
I learned that using DDE also can be without opening xls file.&lt;BR /&gt;
SAS is a really amazing tool.</description>
      <pubDate>Wed, 28 Jul 2010 15:31:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Assigning-data-to-designated-cells-in-Excel-Spreadsheet/m-p/55456#M15438</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2010-07-28T15:31:45Z</dc:date>
    </item>
  </channel>
</rss>

