Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Newsgroup Archive
Excel Newsgroups
Excel Programming
Enabled property failing when code tries to set it
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="Dave Peterson, post: 6326067"] You're not going through the shapes collection to get to the commandbuttons in this code. Shapes don't have an .enabled property. You could use this if you went through the shapes collection, but it's still dangerous: shap.OLEFormat.Object.Enabled = False If I wanted to disable all the commandbuttons on a worksheet, I'd use: Dim OLEObj as oleobject for each oleobj in worksheets("Main Menu").oleobjects If TypeOf OLEObj.Object Is MSForms.commandbutton Then OLEObj.Object.enabled = false End If next oleobj Ron de Bruin has some very nice notes about shapes here: [URL]http://www.rondebruin.nl/controlsobjectsworksheet.htm[/URL] [/QUOTE]
Verification
Post reply
Forums
Archive
Newsgroup Archive
Excel Newsgroups
Excel Programming
Enabled property failing when code tries to set it
Top