Excel Password protect using SAS Export?

Posted: February 26, 2011 in My SAS Issues

Can any one help me to write a small SAS program which will add password (read only) to an MS-EXCEL file while creating it from a SAS Dataset (Export: By using Proc Export or DDE facility) ??

Comments
  1. palundra says:

    You have to add the following SAS code at the end of exporting procedure..when you save the file:
    %let xlsFilePath = ‘path to you template file’;

    filename dcs dde ‘excel|system’;
    data _null_;
    file dcs;
    put ‘[save.as(“‘”&xlsFilePath”‘”,1,”‘”password”‘”)]’;
    put ‘[error(false)]’;
    put ‘[file.close(true)]’;
    put ‘[quit()]’;
    run;

Leave a comment