Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 394
Default Form Button Security

Hi everyone,

What I would like to do is to stop somebody right clicking the Form
Button and assigning another Macro to it. I have Passworded the VBA
Code.
Any help will be greatly appreciated.

Thanks in advance.
All the Best.
Paul

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Form Button Security

Hi Paul,

Try:

'=============
Private Sub Workbook_Activate()
Application.CommandBars("Excel Control"). _
FindControl(ID:=859).Enabled = False
End Sub

'--------------

Private Sub Workbook_Deactivate()
Application.CommandBars("Excel Control"). _
FindControl(ID:=859).Enabled = True
End Sub

'--------------

Private Sub Workbook_Open()
Application.CommandBars("Excel Control"). _
FindControl(ID:=859).Enabled = False
End Sub
'<<=============

This is workbook event code and should be pasted into the workbook's
ThisWorkbook module *not* a standard module or a sheet module:

Right-click the Excel icon on the worksheet
(or the icon to the left of the File menu if your workbook is maximised)
Select 'View Code' from the menu and paste the code.
Alt-F11 to return to Excel.


---
Regards,
Norman


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 394
Default Form Button Security

Thanks for the reply Norman, I will certainly give it a go.

All the Best.
Paul

Norman Jones wrote:
Hi Paul,

Try:

'=============
Private Sub Workbook_Activate()
Application.CommandBars("Excel Control"). _
FindControl(ID:=859).Enabled = False
End Sub

'--------------

Private Sub Workbook_Deactivate()
Application.CommandBars("Excel Control"). _
FindControl(ID:=859).Enabled = True
End Sub

'--------------

Private Sub Workbook_Open()
Application.CommandBars("Excel Control"). _
FindControl(ID:=859).Enabled = False
End Sub
'<<=============

This is workbook event code and should be pasted into the workbook's
ThisWorkbook module *not* a standard module or a sheet module:

Right-click the Excel icon on the worksheet
(or the icon to the left of the File menu if your workbook is maximised)
Select 'View Code' from the menu and paste the code.
Alt-F11 to return to Excel.


---
Regards,
Norman


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
macro and button security dr chuck Excel Programming 3 July 15th 06 07:39 PM
Form Security elyse Excel Discussion (Misc queries) 0 July 3rd 06 02:41 PM
Command Button vs Form Button Bri[_3_] Excel Programming 2 February 3rd 06 08:18 AM
Pause macro, add form button to sheet, continue macro when button clicked! Flystar[_15_] Excel Programming 1 May 26th 04 09:45 AM
Command Button vs Form Button T K Excel Programming 4 August 26th 03 07:26 PM


All times are GMT +1. The time now is 07:17 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"