![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: May 2002
Posts: 13
|
Hey,
I have a sheet with macro's which link to sheets, now this sheet is ment to be protected. BUT when i went Protect Sheet and entered a password, i could just click the buttons as normal with out Excel protecting. So is there anyway to protect a sheet and the buttons or pictures assigned to a macros? Thanks Mike |
|
|
|
|
|
#2 |
|
Join Date: May 2002
Posts: 26
|
The macros assigned to the buttons will not be able to make changes to a protected worksheet.
|
|
|
|
|
|
#3 |
|
Board Regular
Join Date: May 2002
Posts: 206
|
Sheet protection won't disable a command button. You'll need to disable the buttons with VBA.
Private Sub Worksheet_Activate() CommandButton1.Enabled = False End Sub Hope this helps ***EDIT Forgot to mention, you'll also have to use VBA to set it back to True. [ This Message was edited by: dsnbld on 2002-05-18 19:15 ] |
|
|
|
|
|
#4 |
|
Join Date: May 2002
Posts: 26
|
Alternatively, you could put this code at the start of your macro(s) :-
If Application.ExecuteExcel4Macro("get.document(7)") Then MsgBox "Sheet Whatever is protected. You must unprotect it before you can run this macro" Exit Sub End If |
|
|
|
|
|
#5 |
|
New Member
Join Date: May 2002
Posts: 13
|
Thx works like a dreem >
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|