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.
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:
This will allow you to save the file without warning messages
put '[Save.As(" '"' "&savepath" '\' "&savename" '")]' "'; put '[File.Close(false)]';