Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Custom button behaviour (activation and deactivation)

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Custom button behaviour (activation and deactivation)

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)

"David Torrejón" wrote in message
oups.com...
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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Custom button behaviour (activation and deactivation)

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

On Jul 10, 8:05 pm, "Bob Phillips" wrote:
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)

"David Torrejón" wrote in message

oups.com...
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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Custom button behaviour (activation and deactivation)

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
On Jul 10, 8:50 pm, David Torrejón wrote:
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

On Jul 10, 8:05 pm, "Bob Phillips" wrote:

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)


"David Torrejón" wrote in message


roups.com...
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange Option Button behaviour [email protected] Excel Programming 1 March 21st 06 12:37 PM
Worksheet Deactivation Event DynamiteSkippy Excel Programming 1 May 28th 05 06:51 PM
Insert comment behaviour on custom shortcut different quartz[_2_] Excel Programming 0 April 11th 05 01:59 PM
Custom Function behaviour? Ron[_28_] Excel Programming 7 December 30th 04 11:10 PM
change of button properties upon activation Jos reulen Excel Programming 1 November 17th 03 04:44 PM


All times are GMT +1. The time now is 01:51 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"