DATA Step, Macro, Functions and more

Need to save excel with password

Reply
Contributor
Posts: 30

Need to save excel with password

trying to save the excel with password but the session is hungup when I tried

can someone explain me the put statement

put '[open(file)]'

put '[save.as('file',1,'password')]' 

put '[quit]'

Need to know that 1 stands for what how to tweak without creating file without Password and opening it ans saving with password 

without that can we do on singel step create password protected file directly?

Contributor
Posts: 26

Re: Need to save excel with password

bump; I too would like to know what the options for the save.as command are (or how to find them)

Respected Advisor
Posts: 3,799

Re: Need to save excel with password

Posted in reply to ewgrashorn

I would not bother with DDE.

This example may be helpful. https://communities.sas.com/message/128871#128871

Super User
Super User
Posts: 7,060

Re: Need to save excel with password

I simple google search found this page from Microsoft.

SaveAs Method [Excel 2007 Developer Reference]

Contributor
Posts: 26

Re: Need to save excel with password

Thanks Tom, that's a useful reference for the SaveAs method, but I'm more interested in the documentation of the method described in the original post, save.as  In case anyone actually cares about this (which I doubt, since further searching suggests that dde has been deprecated in favor of ODS), I was able to figure out (via trial and error, which seems to be the most useful way to figure out how to use SAS) how to get save.as to work in my situation: I was having issues opening the spreadsheet created in Excel 2007 format (.xlsx), but the spreadsheet opened just fine when created in Excel 2003 format (.xls).  If you find yourself coming to this post because of similar issues in opening a spreadsheet created via the save.as method, you might find this useful.

Regular Contributor
Posts: 151

Re: Need to save excel with password

Recommend you google search for "macrofun.hlp".

Ask a Question
Discussion stats
  • 5 replies
  • 288 views
  • 1 like
  • 5 in conversation