View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default Saving with password

Hi Alan,

Perhaps, try something like:

'=============
Public Sub Tester()
Const PWORD As String = "ABC" '<<==== CHANGE

Application.DisplayAlerts = False
With ActiveWorkbook
.SaveAs Filename:=.FullName, _
Password:=PWORD
End With
Application.DisplayAlerts = True
End Sub
'<<=============



---
Regards,
Norman


"Alan P" wrote in message
...
I have files that I need to save with a passord each month. I'd like to
automate this as the password will be the same. The location (of all the
files) will be different each month, so using SaveAs won't help too much
unless I want to change the code each month. I tried ThisWorkbook Save and
ActiveWorkbook Save and they didn't work with Pasword. Anyione have any
thouhts?

Thanks,

Alan