Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
changing a file password from something to nothing
I would like to save a file with a password and then later save the same file
in the same location and with the same name but remove the password. Does any one know what the syntax should be. I'm new to VBA, but Excel seems to be acting weird when I try to do this. Does anyone know why I can't just use the SaveAs method and specify Password:="". The only way the code does work is if I first changed the password to a string and then change it again to nothing. It seems redundant. Maybe I've missed something. This is the routine that finally worked: Sub save_wo_passwd() Application.DisplayAlerts = False Fname = ActiveWorkbook.FullNameURLEncoded ActiveWorkbook.SaveAs Filename:=Fname, _ FileFormat:=xlNormal, Password:="1234" ActiveWorkbook.SaveAs Filename:=Fname, Password:="" Application.DisplayAlerts = True ActiveWorkbook.Save ActiveWorkbook.Close End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
changing a password protected file | Excel Discussion (Misc queries) | |||
PASSWORD REMOVAL I have the password to open the file and the password to modify the file now how to remove them | Excel Programming | |||
changing password to **** | Excel Programming | |||
how to automate opening a password protected excel file? e.g. a .xls that has a password set in the security tab. | Excel Worksheet Functions | |||
bypass password when update linking of password protected file | Excel Discussion (Misc queries) |