<?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 DDE from a stored process, error in Developers</title>
    <link>https://communities.sas.com/t5/Developers/DDE-from-a-stored-process-error/m-p/67396#M3325</link>
    <description>Hi run the following code from Enterprise Guide to add a custom worksheet to an existing workbook.  In Enterprise Guide--&amp;gt;File---&amp;gt;New--&amp;gt;Program, paste the code below in and run, it works fine.  Excel opens, tab is added and populated, then the workbook is saved and closed.  If I take this exact code and create a stored process out of it I get the error: ERROR: Physical file does not exist, excel|system.  Any ideas?&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
/** initiate the link to Excel **/&lt;BR /&gt;
options noxsync noxwait xmin;&lt;BR /&gt;
filename sas2xl dde 'excel|system';&lt;BR /&gt;
&lt;BR /&gt;
data _null_;&lt;BR /&gt;
length fid rc start stop time 8;&lt;BR /&gt;
fid=fopen('sas2xl','s');&lt;BR /&gt;
if (fid le 0) then do;&lt;BR /&gt;
	rc=system('start excel');&amp;#1;&lt;BR /&gt;
	start=datetime();&lt;BR /&gt;
	stop=start+10;&lt;BR /&gt;
	do while (fid le 0);&lt;BR /&gt;
		fid=fopen('sas2xl','s');&lt;BR /&gt;
		time=datetime();&lt;BR /&gt;
		if (time ge stop) then fid=1;&lt;BR /&gt;
	end;&lt;BR /&gt;
end;&lt;BR /&gt;
rc=fclose(fid);&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
/** lets get manipulating! **/&lt;BR /&gt;
data _null_;&lt;BR /&gt;
	file sas2xl;&lt;BR /&gt;
&lt;BR /&gt;
	/** open the workbook */&lt;BR /&gt;
	put '[error(false)]';&lt;BR /&gt;
	put '[open("c:\temp\web_output.xls")]';&lt;BR /&gt;
&lt;BR /&gt;
	/** create a new tab for the summary **/&lt;BR /&gt;
	put '[workbook.insert(1)]';&lt;BR /&gt;
&lt;BR /&gt;
	/** name the newly created sheet **/&lt;BR /&gt;
	put '[workbook.name("sheet3","Summary")]';&lt;BR /&gt;
run;</description>
    <pubDate>Thu, 26 Aug 2010 19:52:37 GMT</pubDate>
    <dc:creator>FrankE</dc:creator>
    <dc:date>2010-08-26T19:52:37Z</dc:date>
    <item>
      <title>DDE from a stored process, error</title>
      <link>https://communities.sas.com/t5/Developers/DDE-from-a-stored-process-error/m-p/67396#M3325</link>
      <description>Hi run the following code from Enterprise Guide to add a custom worksheet to an existing workbook.  In Enterprise Guide--&amp;gt;File---&amp;gt;New--&amp;gt;Program, paste the code below in and run, it works fine.  Excel opens, tab is added and populated, then the workbook is saved and closed.  If I take this exact code and create a stored process out of it I get the error: ERROR: Physical file does not exist, excel|system.  Any ideas?&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
/** initiate the link to Excel **/&lt;BR /&gt;
options noxsync noxwait xmin;&lt;BR /&gt;
filename sas2xl dde 'excel|system';&lt;BR /&gt;
&lt;BR /&gt;
data _null_;&lt;BR /&gt;
length fid rc start stop time 8;&lt;BR /&gt;
fid=fopen('sas2xl','s');&lt;BR /&gt;
if (fid le 0) then do;&lt;BR /&gt;
	rc=system('start excel');&amp;#1;&lt;BR /&gt;
	start=datetime();&lt;BR /&gt;
	stop=start+10;&lt;BR /&gt;
	do while (fid le 0);&lt;BR /&gt;
		fid=fopen('sas2xl','s');&lt;BR /&gt;
		time=datetime();&lt;BR /&gt;
		if (time ge stop) then fid=1;&lt;BR /&gt;
	end;&lt;BR /&gt;
end;&lt;BR /&gt;
rc=fclose(fid);&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
/** lets get manipulating! **/&lt;BR /&gt;
data _null_;&lt;BR /&gt;
	file sas2xl;&lt;BR /&gt;
&lt;BR /&gt;
	/** open the workbook */&lt;BR /&gt;
	put '[error(false)]';&lt;BR /&gt;
	put '[open("c:\temp\web_output.xls")]';&lt;BR /&gt;
&lt;BR /&gt;
	/** create a new tab for the summary **/&lt;BR /&gt;
	put '[workbook.insert(1)]';&lt;BR /&gt;
&lt;BR /&gt;
	/** name the newly created sheet **/&lt;BR /&gt;
	put '[workbook.name("sheet3","Summary")]';&lt;BR /&gt;
run;</description>
      <pubDate>Thu, 26 Aug 2010 19:52:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/DDE-from-a-stored-process-error/m-p/67396#M3325</guid>
      <dc:creator>FrankE</dc:creator>
      <dc:date>2010-08-26T19:52:37Z</dc:date>
    </item>
    <item>
      <title>Re: DDE from a stored process, error</title>
      <link>https://communities.sas.com/t5/Developers/DDE-from-a-stored-process-error/m-p/67397#M3326</link>
      <description>Hi:&lt;BR /&gt;
  I can think of a few things:&lt;BR /&gt;
1) Remember that a stored process is running on either the Stored Process Server or the Workspace server. If the server is a UNIX or LINUX server, it probably does NOT have a C drive. So your physical file error could come from your references to c:\temp. If your server is a Windows box and it DOES have a C drive, then there might not be a TEMP directory on that drive.&lt;BR /&gt;
OR&lt;BR /&gt;
2) The server on which the stored process is running does NOT have Excel (which would also be the case if the server was a UNIX or LINUX server). This would make your "start excel" command have problems.&lt;BR /&gt;
OR&lt;BR /&gt;
3) Also remember that the Stored Process Server and the Workspace Server generally do not have write access to YOUR machine's C drive (if you wanted to have the XLS file returned to your C drive).&lt;BR /&gt;
               &lt;BR /&gt;
  Are you using the SAS Add-in for Microsoft Office?? When you submit an SP using the Add-in, you have the choice to put the SP results into a new workbook or a new sheet in the existing workbook.&lt;BR /&gt;
&lt;BR /&gt;
  Even though your program works in EG (are you submitting this on a LOCAL server or LOCAL installation of SAS?), I'm not entirely sure that it would work as a stored process. This is probably a question for Tech Support. They would know whether this would work or whether there are VB/.NET methods to use to add a sheet to an existing Workbook by calling a stored process.          &lt;BR /&gt;
             &lt;BR /&gt;
  To open a track with Tech Support, fill out the form at this link:&lt;BR /&gt;
&lt;A href="http://support.sas.com/ctx/supportform/createForm" target="_blank"&gt;http://support.sas.com/ctx/supportform/createForm&lt;/A&gt;&lt;BR /&gt;
    &lt;BR /&gt;
cynthia</description>
      <pubDate>Thu, 26 Aug 2010 20:40:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/DDE-from-a-stored-process-error/m-p/67397#M3326</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2010-08-26T20:40:02Z</dc:date>
    </item>
  </channel>
</rss>

