Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Alex has provided an excellent solution - but just to add
If the user has disabled macros when opening the workbook (or in xl2002 and higher, security is set to high and you have not provided a certificate accepted by the user - macros disabled silently in this case), the code won't execute -- Regards, Tom Ogilvy "Alex Guardiet" wrote in message ... Hi, if you place the following code in the ThisWorkbook module (go to ToolsMacrosVisual Basic Editor and double click on ThisWorkbook in the Project window on the upper-left-hand side): Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) psw = Application.InputBox("Password:") If psw < "hello" Then Cancel = True End Sub In my example the password is "hello". You can change it to whatever you want. Regards, Alex "WvR" wrote: When the user click on File Save, I want to interrupt and ask for a password. Can someone please help??????? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|