LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default File_Save

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???????



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 10:56 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"