Andybuck86
11-28-2010, 07:18 AM
Hi,
I really need some help please!
I have the following VBA in a module in my workbook
Option Explicit
Sub Save_Password()
Dim Open_Password As String
Dim New_File_Name As String
New_File_Name = Range("G2").Value & "\" & Range("G1").Value & ".xlsm"
Open_Password = InputBox("Please enter a password to stop others from editing your timesheet. YOU MUST REMEMBER THIS PASSWORD")
ActiveWorkbook.SaveAs New_File_Name, _
WriteResPassword:=Open_Password, _
Password:="heather"
' ActiveWorkbook.SaveAs New_File_Name, _ ' creates a new file with the name in G1
' Password:=Open_Password, _ ' this is the password the user enters
' WriteResPassword:="password" ' this is the master password
End Sub
This is assigned to a button. When pressed it requests the user create a write password and saves the file based on variable cells in the workbook.
This works great HOWEVER when the user then goes back into the workbook and makes changes, the save as button will not work. When pressed the message 'Can not access.....' comes up.
I think this is potentially because the workbook is password protected??
Does anybody know of a solution?
Many Thanks in Advance
Andy
I really need some help please!
I have the following VBA in a module in my workbook
Option Explicit
Sub Save_Password()
Dim Open_Password As String
Dim New_File_Name As String
New_File_Name = Range("G2").Value & "\" & Range("G1").Value & ".xlsm"
Open_Password = InputBox("Please enter a password to stop others from editing your timesheet. YOU MUST REMEMBER THIS PASSWORD")
ActiveWorkbook.SaveAs New_File_Name, _
WriteResPassword:=Open_Password, _
Password:="heather"
' ActiveWorkbook.SaveAs New_File_Name, _ ' creates a new file with the name in G1
' Password:=Open_Password, _ ' this is the password the user enters
' WriteResPassword:="password" ' this is the master password
End Sub
This is assigned to a button. When pressed it requests the user create a write password and saves the file based on variable cells in the workbook.
This works great HOWEVER when the user then goes back into the workbook and makes changes, the save as button will not work. When pressed the message 'Can not access.....' comes up.
I think this is potentially because the workbook is password protected??
Does anybody know of a solution?
Many Thanks in Advance
Andy