Description:-
I have one dataset called abc.sas7bdat and i need to export as excel/csv with password protected.
I have gone through different post but not getting proper solution.
ods tagsets.excelxp file="/SASCommon/test/DEBT_2019-07-31.xml";
proc print data=sashelp.class;
run;
ods tagsets.excelxp close;
/*****************************************************************/
/* Create and excecute a script file using the input XML file */
/* and the converted XLSX file. The value 51 is needed for XLSX. */
/* Use the value of 1 for XLS files in the SaveAs command. */
/*****************************************************************/
%let XMLfile = /SASCommon/test/DEBT_2019-07-31.xml;
%let ExcelFile = /SASCommon/test/DEBT_2019-07-31.xlsx;
%let VBscript = c:\convert.vbs;
%let password=test;
data _null_;
file "&vbscript" lrecl=200;
put 'Dim xlApp, xlWkb, SourceFile, TargetFile';
put 'Set xlApp = CreateObject("excel.application")';
put 'SourceFile="' "&XMLfile" '"';
put 'Set xlWkb = xlApp.Workbooks.Open(SourceFile)';
put 'TargetFile="' "&ExcelFile" '"';
put 'xlApp.DisplayAlerts=false';
put "xlWkb.SaveAs TargetFile, 51,""&password""";
put 'xlApp.DisplayAlerts=true';
put 'xlWkb.close';
run;
options noxwait noxsync;
x "cscript ""&vbscript""";
I got this code on sas support website but I am not able to understand the cscript in X command.
please help me and give me some solution what is this cscript.
Thanks in advance.