Set ActiveX CheckBox Values OnMouseUp - ClickEvent Workaround

bs0d

Well-known Member
Joined
Dec 29, 2006
Messages
622
I'm having the issue where the click event gets triggered for my activex checkboxes. If I change the OLEObject's behavior to _MouseUp, then that seems to fix the click event issue. But a new problem surfaces in setting the value of the checkbox. A simple: Sheets("SheetName").chkBoxName.value = TRUE or FALSE does not work.

Does anyone have feedback on resolving this? I can get the checkbox to set to TRUE by creating a custom function that sets the value outside of the _MouseUp subroutine, but it will not set the false value. (Code below):
Code:
Sub checkbox_ClickSet (clickValue as Boolean, chkBoxName as OLEObject)
chkBoxName.Object.Value = clickValue
end sub

call in mycheckbox_MouseUp:
Code:
Module1.checkbox_ClickSet True, Sheets("SheetName").OLEObjects("mycheckbox")


Note: I did try application.enableEvents = False (before) , back to = False (after code) , but that' did work for me.

Thanks,
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Perhaps there are other ways to just 'rest' or 'clear' an activex object. Since unchecked is the default, that may work. Any thoughts?
 
Upvote 0
Unable to find a solution so far. If anyone has feedback on ways to prevent _click events from triggering and setting checkbox values it would be appreciated.
 
Upvote 0

Forum statistics

Threads
1,223,157
Messages
6,170,419
Members
452,325
Latest member
BlahQz

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