<?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: DDE session not ready when using the Excel select function in Microsoft Integration with SAS</title>
    <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/DDE-session-not-ready-when-using-the-Excel-select-function/m-p/99440#M1192</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I suppose that you have to reassigne filename before using select.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From&lt;/P&gt;&lt;P&gt;filename DDEcmds dde "excel|system";&lt;/P&gt;&lt;P&gt;To&lt;/P&gt;&lt;P&gt;filename DDEcmds dde "excel|sheet_name_!r3c1:r29C256" notab;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notice, that you should type real sheet name in the filename statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Oleg.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 01 Oct 2013 13:39:44 GMT</pubDate>
    <dc:creator>Oleg_L</dc:creator>
    <dc:date>2013-10-01T13:39:44Z</dc:date>
    <item>
      <title>DDE session not ready when using the Excel select function</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/DDE-session-not-ready-when-using-the-Excel-select-function/m-p/99439#M1191</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would like to ask about DDE with Excel. I tried SAS 9.3 with Excel97-2003 (.xls) as well as Excel2013(.xlsx).&lt;/P&gt;&lt;P&gt;The statement&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; put '[select("C2")]'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;always leads to the Error:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;ERROR: DDE session not ready.&lt;/P&gt;&lt;P&gt;FATAL: Unrecoverable I/O error detected in the execution of the DATA step program.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Aborted during the EXECUTION phase.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is surprising because the statement before:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Courier New;"&gt;put&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 10pt; font-family: Courier New;"&gt;'[freeze.panes(true,0,1)]'&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;did work, which should mean that Excel was ready.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;Can someone give a tip how the select statement can be made working.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;Here is the example code where the error occurred:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data example;&lt;BR /&gt;&amp;nbsp; a=1; b=2; c=3; output;&lt;BR /&gt;&amp;nbsp; a=4; b=5; c=6; output;&lt;BR /&gt;&amp;nbsp; a=7; b=8; c=9; output;&lt;BR /&gt;&amp;nbsp; a=10; b=11; c=12; output;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;PROC EXPORT DATA=example OUTFILE="M:\SAS_test\example.xlsx" &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DBMS=excel REPLACE;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;options noxsync noxwait;&lt;/P&gt;&lt;P&gt;filename DDEcmds dde "excel|system";&lt;/P&gt;&lt;P&gt;x '"C:\Program Files\Microsoft Office\Office15\EXCEL.exe"';&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;&amp;nbsp; dummy = sleep(3);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;&amp;nbsp; file DDEcmds;&lt;BR /&gt;&amp;nbsp; put '[open("M:\SAS_test\example.xlsx")]';&lt;BR /&gt;&amp;nbsp; dummy = sleep(3);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;&amp;nbsp; file DDEcmds;&lt;BR /&gt;&amp;nbsp; put '[freeze.panes(true,0,1)]';&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;&amp;nbsp; file DDEcmds;&lt;BR /&gt;&amp;nbsp; put '[select("C2")]';&lt;BR /&gt;&amp;nbsp; put '[insert]';&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;&amp;nbsp; file DDEcmds;&lt;BR /&gt;&amp;nbsp; put '[save]';&lt;BR /&gt;&amp;nbsp; put '[error(false)]';&lt;BR /&gt;&amp;nbsp; put '[quit()]';&lt;BR /&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Oct 2013 11:38:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/DDE-session-not-ready-when-using-the-Excel-select-function/m-p/99439#M1191</guid>
      <dc:creator>Ulrich</dc:creator>
      <dc:date>2013-10-01T11:38:09Z</dc:date>
    </item>
    <item>
      <title>Re: DDE session not ready when using the Excel select function</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/DDE-session-not-ready-when-using-the-Excel-select-function/m-p/99440#M1192</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I suppose that you have to reassigne filename before using select.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From&lt;/P&gt;&lt;P&gt;filename DDEcmds dde "excel|system";&lt;/P&gt;&lt;P&gt;To&lt;/P&gt;&lt;P&gt;filename DDEcmds dde "excel|sheet_name_!r3c1:r29C256" notab;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Notice, that you should type real sheet name in the filename statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Oleg.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Oct 2013 13:39:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/DDE-session-not-ready-when-using-the-Excel-select-function/m-p/99440#M1192</guid>
      <dc:creator>Oleg_L</dc:creator>
      <dc:date>2013-10-01T13:39:44Z</dc:date>
    </item>
    <item>
      <title>Re: DDE session not ready when using the Excel select function</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/DDE-session-not-ready-when-using-the-Excel-select-function/m-p/99441#M1193</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much, Oleg!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This was the right hint.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Following example works perfectly now:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data example;&lt;BR /&gt;&amp;nbsp; a=1; b=2; c=3; output;&lt;BR /&gt;&amp;nbsp; a=4; b=5; c=6; output;&lt;BR /&gt;&amp;nbsp; a=7; b=8; c=9; output;&lt;BR /&gt;&amp;nbsp; a=10; b=11; c=12; output;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;PROC EXPORT DATA=example OUTFILE="M:\SAS_test\example.xlsx" &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DBMS=excel REPLACE;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;options noxsync noxwait;&lt;/P&gt;&lt;P&gt;filename DDEcmds dde "excel|system";&lt;/P&gt;&lt;P&gt;x '"C:\Program Files\Microsoft Office\Office15\EXCEL.exe"';&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;&amp;nbsp; dummy = sleep(3);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;&amp;nbsp; file DDEcmds;&lt;BR /&gt;&amp;nbsp; put '[open("M:\SAS_test\example.xlsx")]';&lt;BR /&gt;&amp;nbsp; dummy = sleep(3);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;&amp;nbsp; file DDEcmds;&lt;BR /&gt;&amp;nbsp; put '[freeze.panes(true,0,1)]';&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;filename DDEcmds dde "excel|EXAMPLE![M:\SAS_test\example.xlsx]r1c1:r1c1" notab;&lt;BR /&gt;data _null_;&lt;BR /&gt;&amp;nbsp; file DDEcmds;&lt;BR /&gt;&amp;nbsp; put '[select("C2")]';&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;filename DDEcmds dde "excel|system";&lt;BR /&gt;data _null_;&lt;BR /&gt;&amp;nbsp; file DDEcmds;&lt;BR /&gt;&amp;nbsp; put '[insert(4)]';&lt;BR /&gt;&amp;nbsp; put '[save]';&lt;BR /&gt;&amp;nbsp; put '[error(false)]';&lt;BR /&gt;&amp;nbsp; put '[quit()]';&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Ulrich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Oct 2013 14:49:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/DDE-session-not-ready-when-using-the-Excel-select-function/m-p/99441#M1193</guid>
      <dc:creator>Ulrich</dc:creator>
      <dc:date>2013-10-01T14:49:10Z</dc:date>
    </item>
    <item>
      <title>Re: DDE session not ready when using the Excel select function</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/DDE-session-not-ready-when-using-the-Excel-select-function/m-p/99442#M1194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You should've been able to achieve similar results by first selecting a targetted sheet between open and select. I forget the syntax though but I had used the "excel|system" incomplete DDE triplet for an example on how to insert a jpg image in a targetted worksheet cell a few months ago.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here was the code I used to achieve this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;options noxwait noxsync;&lt;BR /&gt;x '"C:\Program Files\Microsoft Office\Office12\EXCEL.exe"'; &lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; z=sleep(8); /* 5seconds sleep, needs to be long enough for excel to open */&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;filename DDEcmds dde "Excel|SYSTEM"; &lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; file ddecmds;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put '[open("C:\testexcelfile.xlsx"]';&lt;BR /&gt;&amp;nbsp; z=sleep(3);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put '[workbook.activate("Sheet1")]';&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put '[select("R4C12")]';&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put '[insert.picture("C:\users\public\pictures\sample pictures\forest.jpg")]';&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put '[save()]';&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put '[error(false)]';&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; z=sleep(5); /* give it enough time to save, if it's a huge excel document, increase this value */&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put '[quit()]';&lt;BR /&gt; &lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;*options xwait xsync;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway point being, you could've stuck to&lt;/P&gt;&lt;P&gt;filename DDEcmds dde "excel|system"; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;all along for so long as you activated a worksheet prior to attempting to select cells as with the workbook.activate("sheet_name") command above.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vince&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Oct 2013 15:12:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/DDE-session-not-ready-when-using-the-Excel-select-function/m-p/99442#M1194</guid>
      <dc:creator>Vince28_Statcan</dc:creator>
      <dc:date>2013-10-01T15:12:44Z</dc:date>
    </item>
    <item>
      <title>Re: DDE session not ready when using the Excel select function</title>
      <link>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/DDE-session-not-ready-when-using-the-Excel-select-function/m-p/99443#M1195</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Oleg and Vince,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as I wrote before, at a first glance, Oleg's suggest did work because there was no error message no more.&lt;/P&gt;&lt;P&gt;However, there was also no really selection of cells.&lt;/P&gt;&lt;P&gt;Vince's suggest also didn't solve this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I found a way by using key strokes, for instance:&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; file DDEcmds;&lt;/P&gt;&lt;P&gt;&amp;nbsp; put '[workbook.activate("EXAMPLE")]';&lt;/P&gt;&lt;P&gt;&amp;nbsp; put '[app.activate("example - Excel")]';&lt;/P&gt;&lt;P&gt;&amp;nbsp; put '[send.keys("^{home}")]';&lt;/P&gt;&lt;P&gt;&amp;nbsp; put '[send.keys("{right}")]';&lt;/P&gt;&lt;P&gt;&amp;nbsp; put '[send.keys("+{right}")]';&lt;/P&gt;&lt;P&gt;&amp;nbsp; put '[send.keys("+{right}")]';&lt;/P&gt;&lt;P&gt;&amp;nbsp; put '[send.keys("+{down}")]';&lt;/P&gt;&lt;P&gt;&amp;nbsp; put '[font.properties(,"Bold",,,,,,,,3)]';&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This worked under most circumstances.&lt;/P&gt;&lt;P&gt;It could certainly be developped as a select cell macro.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again for your suggestions, they helped on this topic anyway,&lt;/P&gt;&lt;P&gt;Ulrich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Oct 2013 15:14:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Microsoft-Integration-with-SAS/DDE-session-not-ready-when-using-the-Excel-select-function/m-p/99443#M1195</guid>
      <dc:creator>Ulrich</dc:creator>
      <dc:date>2013-10-11T15:14:19Z</dc:date>
    </item>
  </channel>
</rss>

