Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Password issue
I have a template file which I limit access to by requiring a password to
open it. What I have done is put a button on the worksheet which allows the user to start a new week based in the Template file. The code opens the Template file and then renames the file based on the date the user selects (this command button is on a dialog box with a calendar control). The problem is, that when it opens the Template file it wants the password. How can I get around this? Private Sub CommandButton1_Click() Unload SelectDate Application.Wait TimeSerial(Hour(Now()), Minute(Now()), Second(Now()) + 5) Application.ScreenUpdating = False Sheets("Sunday").Select Range("A2").Select ActiveWorkbook.Save Application.EnableEvents = False Workbooks.Open(Filename:= _ "P:\SPECDISP\VEH_SCHD\DailyDriverSched.xls" _ ).RunAutoMacros Which:=xlAutoOpen Application.EnableEvents = True Sheets("Sunday").Select Range("B3").Select If Weekday(Calendar1.Value) < 1 Then GoTo Error Else GoTo Continue Continue: Range("I1").Select ActiveCell = Calendar1.Value Sheets("Sunday").Range("A1001").Value = "gggg" ActiveWorkbook.SaveAs Filename:="P:\PT_Driver_Sched\Daily Driver\ " & Worksheets("Sunday").[I2].Value & ", " & " Week of " & Worksheets("Sunday").[I3].Value & ", Daily Driver", _ FileFormat:=xlNormal, Password:="", WriteResPassword:="", _ ReadOnlyRecommended:=False, CreateBackup:=False Sheets("Sunday").Select Range("A2").Select Application.ScreenUpdating = True Application.Wait TimeSerial(Hour(Now()), Minute(Now()), Second(Now()) + 5) GoTo EndMacro Error: SundayWarning.Show EndMacro: End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How can I solve the issue of forgotten password in "sheet"? | Excel Discussion (Misc queries) | |||
Excel Worksheet Password Issue!!!!! | 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 | |||
Password Issue | Excel Discussion (Misc queries) | |||
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 |