Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Protect macro for unauthorised use

How can I protect a macro so that you need to give a password before you can
run the macro?
Once the file is closed the macro protection should automatically be
protected.

Thank you in advance!

  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,718
Default Protect macro for unauthorised use

One way is to ask for the password right in the macro.

Sub PassExample()
Dim PW As String
PW = InputBox("Password please", "Password to Run Macro")
If PW = "pass" Then
MsgBox "Running macro"
Else
MsgBox "Sorry"
End If
End Sub


--
Jim
"Johan_vl2431" wrote in message
...
| How can I protect a macro so that you need to give a password before you
can
| run the macro?
| Once the file is closed the macro protection should automatically be
| protected.
|
| Thank you in advance!
|


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3
Default Protect macro for unauthorised use

Thank you!


Reply
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Protect sheet in macro traima Excel Worksheet Functions 3 March 9th 07 06:05 PM
Protect macro ST Excel Discussion (Misc queries) 1 June 6th 06 06:26 PM
Using macro to un/protect sheet Bonbon Excel Worksheet Functions 2 February 23rd 06 08:14 PM
Add protect worksheet password in macro Kelly Excel Worksheet Functions 1 January 10th 06 02:08 AM
How to protect my macro Protect & Unprotect Several Worksheets Excel Discussion (Misc queries) 1 January 7th 05 02:01 AM


All times are GMT +1. The time now is 12:42 AM.

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"