Question

I need to hide the Data Validation button when user switch to particular sheet, but I cannot locate this button in Application.CommandBars.

I have tried to loop out all the CommandBar object and its control name but still not found, has anyone tried this before?

Was it helpful?

Solution

In Excel 2007, the Data Validation button is in the Ribbon UI (not command bars) - you won't be able to disable it without overwriting the existing Ribbon group (GroupDataTools). See this related SO post regarding how to overwrite existing Ribbon groups. To locate the Control IDs of menu groups in the Ribbon, you can download this list of control ids from Microsoft.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top