SAS DDE excel save as without warning

2.7k views Asked by At

I want to save as the excel file using SAS DDE. Anyone know how to turn off the warnings from excel if the file is exist?

Below is the code:

FILENAME DCMDS DDE'EXCEL|SYSTEM';
DATA _null_;
    FILE dcmds;
    PUT "[save.as(""D:\Reports\sme_fwd.xls"")]";
    PUT "[file.close(FALSE,FALSE)]";
RUN;

In VBA we can set Application.DisplayAlerts = False to turn off the warning, but I don't know what the similar syntax in SAS DDE.

Thank you

2

There are 2 answers

7
Reeza On

You can save instead of save.as if you're working with the same workbook. You can find the DDE references on the Microsoft home page here: http://support.microsoft.com/kb/128185

 put '[error(false)]';
0
DebG9317 On

This will allow you to save the file without warning messages

put '[Save.As(" '"' "&savepath" '\' "&savename" '")]' "';
put '[File.Close(false)]';