Custom button behaviour (activation and deactivation)

  • Thread starter =?iso-8859-1?q?David_Torrej=F3n?=
  • Start date
?

=?iso-8859-1?q?David_Torrej=F3n?=

Hello all,

I would like to add a custom button to an Excel toolbar (Excel 2003)
that could switch between activated and deactivated mode, that is to
say, the same behaviour as Bold, Align Left, Align Center, etc.
buttons, that remain pressed when the functionality is active.

Do you know whether it is possible?

Many thanks in advance


David Torrejón
Madrid, Spain
 
B

Bob Phillips

David,

You need the State property

With Application.CommandBars.ActionControl
.State = Not .State
End With


--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

Hello all,

I would like to add a custom button to an Excel toolbar (Excel 2003)
that could switch between activated and deactivated mode, that is to
say, the same behaviour as Bold, Align Left, Align Center, etc.
buttons, that remain pressed when the functionality is active.

Do you know whether it is possible?

Many thanks in advance


David Torrejón
Madrid, Spain
 
?

=?iso-8859-1?q?David_Torrej=F3n?=

Thanks Bob,

I'm creating a simple example, changing the
CommandBars.ActionControl.State property to msoButtonDown, but when
the procedure finishes the button does not remain pressed. Is this the
normal behaviour?

Regards
 
?

=?iso-8859-1?q?David_Torrej=F3n?=

I'm analyzing using the Watch Window and when I assing the
msoButtonDown to the ...ActionControl.State property the value does
not change, and the msoButtonUp value remains. However, if other
properties like the Caption does change.

Do you know if this property could be locked for some reason?

Thanks again
 
G

Guest

I'm trying to do the same thing David. It appears that the State is
read-only. Have you figured out a fix?

Thanks
Danny
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top