Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Save a File with a Password Q
Is it possible to save via Code a file with a password that resides is
a cell within the workbook? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Save a File with a Password Q
Hi,
Maybe something along these lines Sub Save_Me() MyPass = Sheets("Sheet1").Range("A1").Value Fname = ActiveWorkbook.Name ActiveWorkbook.SaveAs Filename:=Fname, Password:=MyPass End Sub Mike "Seanie" wrote: Is it possible to save via Code a file with a password that resides is a cell within the workbook? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Save a File with a Password Q
this example may be a little more than you were looking for as includes a
test on Path to detrmine if file has been previousley saved - it also shows how to include password from a range value. Hope useful Sub SaveBook() Dim Passwrd As Range Dim FName As Variant Dim FPath As String 'change sheet name & range as required Set Passwrd = Worksheets("Sheet1").Range("A1") Application.DisplayAlerts = False With ThisWorkbook FName = .Name FPath = .Path If FPath < "" Then .SaveAs Filename:=FName, Password:=Passwrd.Value Else FName = Application.GetSaveAsFilename( _ fileFilter:="Excel Files (*.xls), *.xls") If FName < False Then .SaveAs Filename:=FName, Password:=Passwrd.Value End If End If End With Application.DisplayAlerts = True End Sub -- jb "Seanie" wrote: Is it possible to save via Code a file with a password that resides is a cell within the workbook? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
PASSWORD REMOVAL I have the password to open the file and the password to modify the file now how to remove them | Excel Programming | |||
Save file without a password req | 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) | |||
Save protected file into unprotected file without password | Excel Programming |