Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Zip Excel File With Password from SAS

Status
Not open for further replies.

AlboMrsP

MIS
Jul 16, 2010
8
0
0
GB
Hi,

I'm currently trying to zip and password protect an excel file I output on a monthly basis so I can then auto email it to the relevant recipients.

I've tried playing around with DDE and a few other bits I've found on the internet, but, to no avail :-(

Does anyone have any idea how to do this? and if it is possible without the use of DDE?

If the file can't be zipped then just a passworded Excel file would be sufficient...

Thank you loads for any advice you may have
 
Thanks JJ72uk for this info.

I've managed to get the Excel passwording to work, but, not the zipping :-(

I've tried the below code, but, it doesn't work.


%let report1 = c:\sas outputs\Data &prev_yrmth.;
%let filename = %sysfunc(compress(&report1));

data _null_;
put '"c:program files\winzip\winzip32.exe"' "&filename" '.zip ' "&filename" '.xls';
run;

Do you know how to adapt this to work?

Thanks again :)
 
Well..

What error are you getting?

Also ...

Aren't you missing a \

put '"c:\program files\winzip\winzip32.exe"' "&filename" '.zip ' "&filename" '.xls';
 
I fixed it - needed the code to be on a single line.

Yeah, I had a \ missing. It's back in and working fine now.

Thanks for all your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top