Uncheck a checkbox with macro

Started by anico, January 03, 2019, 09:45:48 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

anico

Hi there,

This is probably a simple fix. I have a several checkboxes on a sheet that are checked. In one of my macros, I want to un-check them.

I assumed the syntax for this was: Application.ActiveWindow.CheckboxName.Value = False

That throws an 'object does not support this property or method' error. How can I reference my checkbox to switch it off?

wapperdude

#1
The checkbox isn't a Visio object, so your statement fails.  I believe the following ought to work:


Dim visOle As Visio.OLEObject
Dim visCkBox As Visio.Shape

Set visOle = ActivePage.OLEObjects(visCkBox.Name)
visOle.Object.value = False


HTH
Wapperdude
Visio 2019 Pro

anico

Took me a minute to figure out the checkbox name has to be in quotes, but this works perfect. Thanks!