Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 191
Default Locking Macros

I have my worksheet, workbook and VBE all with the protection turned on. Is
there a way to stop a user from going to Tool - Macro-Macros... and running
a procedure?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 221
Default Locking Macros

Try here

http://www.rondebruin.nl/ribbon.htm

HTH
Mark


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 595
Default Locking Macros

On Fri, 1 Aug 2008 14:01:16 -0700, ranswrt
wrote:

I have my worksheet, workbook and VBE all with the protection turned on. Is
there a way to stop a user from going to Tool - Macro-Macros... and running
a procedure?


Put Private in front of Sub and it will only be accessible to other
procedures in that Module.

Private Sub DoStuff()
....
End Sub

You can also put an argument in the sub and it won't show up in the Macro
dialog.

Sub DoStuff(Optional bFake as Boolean)
....
End Sub

You don't have to do anything with bFake, just its presence will prevent it
from showing up.
--
Dick Kusleika
Microsoft MVP-Excel
http://www.dailydoseofexcel.com
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 191
Default Locking Macros

I used 'bfake' and that worked great. Is any other consequences using
'bfake' other then it not putting the macro in the dialog box?

"Dick Kusleika" wrote:

On Fri, 1 Aug 2008 14:01:16 -0700, ranswrt
wrote:

I have my worksheet, workbook and VBE all with the protection turned on. Is
there a way to stop a user from going to Tool - Macro-Macros... and running
a procedure?


Put Private in front of Sub and it will only be accessible to other
procedures in that Module.

Private Sub DoStuff()
....
End Sub

You can also put an argument in the sub and it won't show up in the Macro
dialog.

Sub DoStuff(Optional bFake as Boolean)
....
End Sub

You don't have to do anything with bFake, just its presence will prevent it
from showing up.
--
Dick Kusleika
Microsoft MVP-Excel
http://www.dailydoseofexcel.com

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 595
Default Locking Macros

I don't think so. Make sure you use the Optional keyword so it doesn't
break any existing macros that call it. Oh, and you won't be able to run it
using F5 in the VBE. You'll have to call it from the Immediate Window, but
that's a small price to pay.

On Sat, 2 Aug 2008 05:56:01 -0700, ranswrt
wrote:

I used 'bfake' and that worked great. Is any other consequences using
'bfake' other then it not putting the macro in the dialog box?

"Dick Kusleika" wrote:

On Fri, 1 Aug 2008 14:01:16 -0700, ranswrt
wrote:

I have my worksheet, workbook and VBE all with the protection turned on. Is
there a way to stop a user from going to Tool - Macro-Macros... and running
a procedure?


Put Private in front of Sub and it will only be accessible to other
procedures in that Module.

Private Sub DoStuff()
....
End Sub

You can also put an argument in the sub and it won't show up in the Macro
dialog.

Sub DoStuff(Optional bFake as Boolean)
....
End Sub

You don't have to do anything with bFake, just its presence will prevent it
from showing up.
--
Dick Kusleika
Microsoft MVP-Excel
http://www.dailydoseofexcel.com

--
Dick


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 191
Default Locking Macros

Thanks for your help

"Dick Kusleika" wrote:

I don't think so. Make sure you use the Optional keyword so it doesn't
break any existing macros that call it. Oh, and you won't be able to run it
using F5 in the VBE. You'll have to call it from the Immediate Window, but
that's a small price to pay.

On Sat, 2 Aug 2008 05:56:01 -0700, ranswrt
wrote:

I used 'bfake' and that worked great. Is any other consequences using
'bfake' other then it not putting the macro in the dialog box?

"Dick Kusleika" wrote:

On Fri, 1 Aug 2008 14:01:16 -0700, ranswrt
wrote:

I have my worksheet, workbook and VBE all with the protection turned on. Is
there a way to stop a user from going to Tool - Macro-Macros... and running
a procedure?

Put Private in front of Sub and it will only be accessible to other
procedures in that Module.

Private Sub DoStuff()
....
End Sub

You can also put an argument in the sub and it won't show up in the Macro
dialog.

Sub DoStuff(Optional bFake as Boolean)
....
End Sub

You don't have to do anything with bFake, just its presence will prevent it
from showing up.
--
Dick Kusleika
Microsoft MVP-Excel
http://www.dailydoseofexcel.com

--
Dick

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
row locking, instead of file locking? Bob W Excel Discussion (Misc queries) 2 September 7th 07 09:36 PM
locking formula in cells in without locking whole sheet SuziQ Excel Discussion (Misc queries) 1 July 21st 06 03:58 PM
locking tabs w/macros erik Excel Discussion (Misc queries) 2 July 6th 05 05:21 PM
Locking Code In Individual Macros Carl Bowman Excel Discussion (Misc queries) 2 May 19th 05 06:05 PM
weird saving of a document with macros resulting with macros being transfered to the copy alfonso gonzales Excel Programming 0 December 12th 04 09:19 PM


All times are GMT +1. The time now is 08:15 PM.

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"