How to make "flat" ActiveX Buttons or Toggle Buttons

jmwbowen

Board Regular
Joined
Jul 27, 2012
Messages
58
I have a workbook with a sheet set up as the user interface to a table of raw data on a hidden sheet. The user interface sheet has buttons to perform various actions on the selected "record" and to navigate back and forth within the records.

The look of the standard MSForms and ActiveX Command Buttons and Toggle Buttons doens't jive with my aesthetics, so I opted to use rectangle shapes assigned to macros to act as buttons. The macro determines the "state" of the shape button by the Forecolor property (I use a light color as "off" and a dark color as "on"). The macro will then change the color as appropriate.

Here's where I've run into a problem. When I protect the sheet without selecting the option to "Edit Objects", I get a runtime error because the macro is trying to edit the object (change color of shape buttons). However, if I select the option to "Edit Objects" when protecting the sheet, it leaves the shape buttons unprotected and vulnerable to accidental modification by the end users.

Toggle Buttons and Command Buttons would be ideal to work around this problem, but, once again, they don't match the look. Even if I change the BackColor of the objects, they still have the visual effect of being raised and sunken. I tried setting the SpecialEffect property of the ToggleButton to flat, but I get an error (apparently, that property is not really supported by Toggle Buttons).

Is there some other way of making Toggle and Command buttons flat? Perhaps some other control or object that I can use as buttons that will support my need to be flat and to allow color changes even with a protected sheet?
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
In the macro why don't you unprotect the worksheet, make the changes required and then protect the worksheet again.
 
Upvote 0

Forum statistics

Threads
1,215,632
Messages
6,125,913
Members
449,274
Latest member
mrcsbenson

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top