Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 18
Default permissions for running macros

I'm very new to macros and am using Excel 2003. I have written a macro to
protect only certain worksheets within my workbook, however I do not want
everybody being able to run this macro. How do I put security on this macro
so only certain individuals have the ability to execute it?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8
Default permissions for running macros

1.- Go to the visual basic editor.
2.- To the left theres a list in Bold "VBA Project (name of your workbook),
right click it
3.- Choose VBA Projet properties
4.- Click the Protection Option
5.- Enable "Lock Project from Viewing" and put some password on it

Thats it, next time you enter you wont be able to view your macros without
the password


"Charlene" wrote:

I'm very new to macros and am using Excel 2003. I have written a macro to
protect only certain worksheets within my workbook, however I do not want
everybody being able to run this macro. How do I put security on this macro
so only certain individuals have the ability to execute it?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 18
Default permissions for running macros

Thank-you but I am not too worried about people being able to view the
properties of a macro, I am worried about people running the macro.

The steps per your instructions disable anybody from viewing the properties
of a macro which is great but the option to run the macro is still there and
when I tried to run it I was able to run it without having to enter that
password that I used for protecting the properties of it. Is there a way so
that when you click on run that it asks for a password before running it?

"Jens Palacios Neffke" wrote:

1.- Go to the visual basic editor.
2.- To the left theres a list in Bold "VBA Project (name of your workbook),
right click it
3.- Choose VBA Projet properties
4.- Click the Protection Option
5.- Enable "Lock Project from Viewing" and put some password on it

Thats it, next time you enter you wont be able to view your macros without
the password


"Charlene" wrote:

I'm very new to macros and am using Excel 2003. I have written a macro to
protect only certain worksheets within my workbook, however I do not want
everybody being able to run this macro. How do I put security on this macro
so only certain individuals have the ability to execute it?

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 709
Default permissions for running macros

Charlene, 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


"Charlene" wrote in message
...
Thank-you but I am not too worried about people being able to view the
properties of a macro, I am worried about people running the macro.

The steps per your instructions disable anybody from viewing the
properties
of a macro which is great but the option to run the macro is still there
and
when I tried to run it I was able to run it without having to enter that
password that I used for protecting the properties of it. Is there a way
so
that when you click on run that it asks for a password before running it?

"Jens Palacios Neffke" wrote:

1.- Go to the visual basic editor.
2.- To the left theres a list in Bold "VBA Project (name of your
workbook),
right click it
3.- Choose VBA Projet properties
4.- Click the Protection Option
5.- Enable "Lock Project from Viewing" and put some password on it

Thats it, next time you enter you wont be able to view your macros
without
the password


"Charlene" wrote:

I'm very new to macros and am using Excel 2003. I have written a macro
to
protect only certain worksheets within my workbook, however I do not
want
everybody being able to run this macro. How do I put security on this
macro
so only certain individuals have the ability to execute it?



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 28
Default permissions for running macros

Or write the code in a Private Sub. It can then only be run from the VBE.

HTH
Roger
Shaftesbury (UK)


"Charlene" wrote in message
...
Thank-you but I am not too worried about people being able to view the
properties of a macro, I am worried about people running the macro.

The steps per your instructions disable anybody from viewing the
properties
of a macro which is great but the option to run the macro is still there
and
when I tried to run it I was able to run it without having to enter that
password that I used for protecting the properties of it. Is there a way
so
that when you click on run that it asks for a password before running it?

"Jens Palacios Neffke" wrote:

1.- Go to the visual basic editor.
2.- To the left theres a list in Bold "VBA Project (name of your
workbook),
right click it
3.- Choose VBA Projet properties
4.- Click the Protection Option
5.- Enable "Lock Project from Viewing" and put some password on it

Thats it, next time you enter you wont be able to view your macros
without
the password


"Charlene" wrote:

I'm very new to macros and am using Excel 2003. I have written a macro
to
protect only certain worksheets within my workbook, however I do not
want
everybody being able to run this macro. How do I put security on this
macro
so only certain individuals have the ability to execute it?





  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default permissions for running macros

A Private Sub will not show in ToolsMacroMacros but can be run just by typing
the name in and "Run"

Assuming the user knows the macro name, of course.


Gord Dibben MS Excel MVP

On Wed, 18 Apr 2007 18:20:11 +0100, "Roger Whitehead"
wrote:

Or write the code in a Private Sub. It can then only be run from the VBE.

HTH
Roger
Shaftesbury (UK)


"Charlene" wrote in message
...
Thank-you but I am not too worried about people being able to view the
properties of a macro, I am worried about people running the macro.

The steps per your instructions disable anybody from viewing the
properties
of a macro which is great but the option to run the macro is still there
and
when I tried to run it I was able to run it without having to enter that
password that I used for protecting the properties of it. Is there a way
so
that when you click on run that it asks for a password before running it?

"Jens Palacios Neffke" wrote:

1.- Go to the visual basic editor.
2.- To the left theres a list in Bold "VBA Project (name of your
workbook),
right click it
3.- Choose VBA Projet properties
4.- Click the Protection Option
5.- Enable "Lock Project from Viewing" and put some password on it

Thats it, next time you enter you wont be able to view your macros
without
the password


"Charlene" wrote:

I'm very new to macros and am using Excel 2003. I have written a macro
to
protect only certain worksheets within my workbook, however I do not
want
everybody being able to run this macro. How do I put security on this
macro
so only certain individuals have the ability to execute it?



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
Running Macros Links and Linking in Excel 3 July 13th 06 11:30 PM
Running Macros Excel Discussion (Misc queries) 1 July 6th 06 04:21 PM
Running Macros Excel Worksheet Functions 0 July 6th 06 03:42 PM
Running Macros when on the LAN Bettergains Excel Discussion (Misc queries) 0 October 6th 05 09:38 PM
Running Macros simpleS Setting up and Configuration of Excel 1 February 17th 05 02:32 PM


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

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

About Us

"It's about Microsoft Excel"