Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel 2010 - Ribbon bar button 1

Status
Not open for further replies.

DAmoss

Technical User
Jul 23, 2003
169
GB
Hi,

Can anyone show me how to disable / enable the 'Protect Workbook' button using VBA, the button is located under the 'Review' menu option on the ribbon bar.

I've looked at the official Microsoft Control Names list and I believe the one I'm trying to toggle is the following:

Control Name: ReviewProtectWorkbook
Ordering: 820
PolicyID: 894

Any VBA help or pointing me in the right direction would be much appreciated ... this ribbon stuff is obviously trickier than I thought!

Cheers
Don
 
hi,

Why do you need to "disable / enable the 'Protect Workbook' button "? Please state your intent.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Hi,

It's because I need to stop users from clicking on 'Protect Workbook' by mistake when they should only be able to use 'Protect Sheet'.

Why do you need to know my 'intent'? What a very strange response to a very straight forward question.

If you're not able to help then I thank you for looking at my question ...

Cheers
 
I service lots of users and never had such an issue. Occasionally, someone states what they think is a solution and there are other betters methods of accomplishing their end result. So I asked the question.

I'd edit the Ribbon in Excel Options by REMOVING the CHANGE Group in the Review Tab.

Then I'd add back in a Custom Group, the Change features to allow your users to use.

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
Hi,

That's a solution of sorts ... but I only want to turn off the 'Protect Workbook' button when a particular spreadsheet that multiple users use is opened and turn it back on when closing. Your solution leaves the Ribbon altered for all spreadsheet's that are opened there after. Hence I need to turn it off / on in VBA so leaving the ribbon button in its original state.

The spreadsheet that I'm trying to alter the ribbon for is shared between eight users. Your solution would require that I alter their individual users ribbons in order to make it work as a solution for all ... never going to happen.

So, back to my original question ... can this be done in VBA and if so how?

Thank you for your time
D
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top