<?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: Question -  DDE to save an Excel file thru SAS w/o it making a backup file? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Question-DDE-to-save-an-Excel-file-thru-SAS-w-o-it-making-a/m-p/28583#M6656</link>
    <description>OK,  I figured it out.&lt;BR /&gt;
&lt;BR /&gt;
In this part:&lt;BR /&gt;
&lt;BR /&gt;
/* Save the changes made */&lt;BR /&gt;
%let excelout = &amp;amp;mydir.\chdaily.xlsx;&lt;BR /&gt;
data _null_;&lt;BR /&gt;
file cmdexcel;&lt;BR /&gt;
put '[error(false)]';&lt;BR /&gt;
put "[save.as(%bquote("&amp;amp;excelout",51))]";&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
---------------------------------------------------------------------&lt;BR /&gt;
the above put '[save.as(......)]';   is now like this:&lt;BR /&gt;
&lt;BR /&gt;
&lt;B&gt;put "[save.as(%bquote("&amp;amp;excelout",51,,false))]"&lt;/B&gt;;&lt;BR /&gt;
&lt;BR /&gt;
The FALSE makes it so no backup is created.&lt;BR /&gt;
I know everyone probably is saying, that they knew that already.  So for all those people that didn't know.  I hope this helps.  &lt;BR /&gt;
&lt;BR /&gt;
Happy programming -- Nancy</description>
    <pubDate>Tue, 08 Jun 2010 19:47:12 GMT</pubDate>
    <dc:creator>SASHunter</dc:creator>
    <dc:date>2010-06-08T19:47:12Z</dc:date>
    <item>
      <title>Question -  DDE to save an Excel file thru SAS w/o it making a backup file?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Question-DDE-to-save-an-Excel-file-thru-SAS-w-o-it-making-a/m-p/28582#M6655</link>
      <description>I am using SAS 9.2 and Excel 2007.&lt;BR /&gt;
&lt;BR /&gt;
I have a program that works well.  It uses PROC EXPORT to create an Excel file.  Then calls Excel to open and I have a workbook that has some macros that format the sheet.  This all works well.  At this point I have SAS running.  Excel is open with the workbook that I have Exported and the workbook that contains the macros.  The macros run and I can see that the workbook that was exported is being updated correctly.  What happens then is I save this exported Excel workbook that has been updated to the original name that I used in the PROC EXPORT.  I am using DDE commands.  &lt;BR /&gt;
&lt;BR /&gt;
                /***************************************************/&lt;BR /&gt;
		/*  Export the new file to Excel 2007            */&lt;BR /&gt;
		/***************************************************/&lt;BR /&gt;
		PROC EXPORT data = lhost.chdaily2 &lt;BR /&gt;
                   (keep = Category Cumulative d:)&lt;BR /&gt;
				 outfile = "&amp;amp;mydir.\chdaily.xlsx"&lt;BR /&gt;
				 DBMS = EXCEL REPLACE;&lt;BR /&gt;
			SHEET="Sheet1";&lt;BR /&gt;
		run;&lt;BR /&gt;
&lt;BR /&gt;
             .....&lt;BR /&gt;
The above works fine.&lt;BR /&gt;
&lt;BR /&gt;
	        data _null_;&lt;BR /&gt;
			file cmdexcel;&lt;BR /&gt;
			put &amp;amp;macrfile;  *open the file containing the macro;&lt;BR /&gt;
			put &amp;amp;chekfile;  *open the daily checkin file;&lt;BR /&gt;
			put '[RUN("chdaily_test_.xlsm!Macro_Daily_Checkin")]'; &lt;BR /&gt;
                               *run the macro;&lt;BR /&gt;
		run;&lt;BR /&gt;
&lt;BR /&gt;
             ....&lt;BR /&gt;
This works fine.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
	/* Save the changes made */&lt;BR /&gt;
		%let excelout = &amp;amp;mydir.\chdaily.xlsx;&lt;BR /&gt;
		data _null_;&lt;BR /&gt;
			file cmdexcel;&lt;BR /&gt;
			put '[error(false)]';&lt;BR /&gt;
			put "[save.as(%bquote("&amp;amp;excelout",51))]";&lt;BR /&gt;
		run;&lt;BR /&gt;
&lt;BR /&gt;
At this point it for some reason it makes a backup file in the directory that it is sitting.&lt;BR /&gt;
&lt;BR /&gt;
Can anyone tell me why?  And if I can stop it from doing the backup.  &lt;BR /&gt;
Also, the line above that says - put '[error(false)]'  -  how would I write this for the excel vba - Application.DisplayAlerts = false - ?&lt;BR /&gt;
&lt;BR /&gt;
Thanks, Nancy</description>
      <pubDate>Fri, 28 May 2010 13:45:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Question-DDE-to-save-an-Excel-file-thru-SAS-w-o-it-making-a/m-p/28582#M6655</guid>
      <dc:creator>SASHunter</dc:creator>
      <dc:date>2010-05-28T13:45:50Z</dc:date>
    </item>
    <item>
      <title>Re: Question -  DDE to save an Excel file thru SAS w/o it making a backup file?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Question-DDE-to-save-an-Excel-file-thru-SAS-w-o-it-making-a/m-p/28583#M6656</link>
      <description>OK,  I figured it out.&lt;BR /&gt;
&lt;BR /&gt;
In this part:&lt;BR /&gt;
&lt;BR /&gt;
/* Save the changes made */&lt;BR /&gt;
%let excelout = &amp;amp;mydir.\chdaily.xlsx;&lt;BR /&gt;
data _null_;&lt;BR /&gt;
file cmdexcel;&lt;BR /&gt;
put '[error(false)]';&lt;BR /&gt;
put "[save.as(%bquote("&amp;amp;excelout",51))]";&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
---------------------------------------------------------------------&lt;BR /&gt;
the above put '[save.as(......)]';   is now like this:&lt;BR /&gt;
&lt;BR /&gt;
&lt;B&gt;put "[save.as(%bquote("&amp;amp;excelout",51,,false))]"&lt;/B&gt;;&lt;BR /&gt;
&lt;BR /&gt;
The FALSE makes it so no backup is created.&lt;BR /&gt;
I know everyone probably is saying, that they knew that already.  So for all those people that didn't know.  I hope this helps.  &lt;BR /&gt;
&lt;BR /&gt;
Happy programming -- Nancy</description>
      <pubDate>Tue, 08 Jun 2010 19:47:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Question-DDE-to-save-an-Excel-file-thru-SAS-w-o-it-making-a/m-p/28583#M6656</guid>
      <dc:creator>SASHunter</dc:creator>
      <dc:date>2010-06-08T19:47:12Z</dc:date>
    </item>
  </channel>
</rss>

