Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi
I need to create a password protected macro. By this I don't mean the code (already done) but the ability to launch the macro itself. I am sending a spreadsheet out and it has several macros inbeded. I got one macro that I am the only one to use and needs to be protected against others launching it. Any Ideas? |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Chris, here is one way,
Sub PassWord_To_Run() 'must lock VBA project so you can't see the password in it Dim MyStr1 As String, MyStr2 As String With ActiveSheet MyStr2 = ("123") 'This is the password and it is CASE sensitive MyStr1 = InputBox("Password Is Required To Run this Macro ") If MyStr1 = MyStr2 Then 'your code here Else MsgBox ("Access Denied") End If End With End Sub -- Paul B Always backup your data before trying something new Please post any response to the newsgroups so others can benefit from it Feedback on answers is always appreciated! Using Excel 2002 & 2003 "Chris" wrote in message ... Hi I need to create a password protected macro. By this I don't mean the code (already done) but the ability to launch the macro itself. I am sending a spreadsheet out and it has several macros inbeded. I got one macro that I am the only one to use and needs to be protected against others launching it. Any Ideas? |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Perfect, exactly what I needed!
Thanks "Paul B" wrote: Chris, here is one way, Sub PassWord_To_Run() 'must lock VBA project so you can't see the password in it Dim MyStr1 As String, MyStr2 As String With ActiveSheet MyStr2 = ("123") 'This is the password and it is CASE sensitive MyStr1 = InputBox("Password Is Required To Run this Macro ") If MyStr1 = MyStr2 Then 'your code here Else MsgBox ("Access Denied") End If End With End Sub -- Paul B Always backup your data before trying something new Please post any response to the newsgroups so others can benefit from it Feedback on answers is always appreciated! Using Excel 2002 & 2003 "Chris" wrote in message ... Hi I need to create a password protected macro. By this I don't mean the code (already done) but the ability to launch the macro itself. I am sending a spreadsheet out and it has several macros inbeded. I got one macro that I am the only one to use and needs to be protected against others launching it. Any Ideas? |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Your welcome, thanks for the feedback
-- Paul B Always backup your data before trying something new Please post any response to the newsgroups so others can benefit from it Feedback on answers is always appreciated! Using Excel 2002 & 2003 "Chris" wrote in message ... Perfect, exactly what I needed! Thanks "Paul B" wrote: Chris, here is one way, Sub PassWord_To_Run() 'must lock VBA project so you can't see the password in it Dim MyStr1 As String, MyStr2 As String With ActiveSheet MyStr2 = ("123") 'This is the password and it is CASE sensitive MyStr1 = InputBox("Password Is Required To Run this Macro ") If MyStr1 = MyStr2 Then 'your code here Else MsgBox ("Access Denied") End If End With End Sub -- Paul B Always backup your data before trying something new Please post any response to the newsgroups so others can benefit from it Feedback on answers is always appreciated! Using Excel 2002 & 2003 "Chris" wrote in message ... Hi I need to create a password protected macro. By this I don't mean the code (already done) but the ability to launch the macro itself. I am sending a spreadsheet out and it has several macros inbeded. I got one macro that I am the only one to use and needs to be protected against others launching it. Any Ideas? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how do I run excel 4.0 macros on excel 2000 | Excel Discussion (Misc queries) | |||
Macros & Passwords | Excel Discussion (Misc queries) | |||
Macros, Protected Books & Missing Passwords | Excel Worksheet Functions | |||
Enabling macros | Excel Discussion (Misc queries) | |||
Transferring toolbars and macros to other computers | Excel Discussion (Misc queries) |