LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to enable / disable ControlButton added to Cell CommandBar

Hi,

I have an addin that adds a ControlButton to the Cell CommandBar as follows:

'/// Read Cell Commandbar and add "View Data"
Set oCellCommandBar = Application.CommandBars("Cell")

If oCellCommandBar.FindControl(, , "ViewData") Is Nothing Then
Set oButton = oCellCommandBar.Controls.Add(msoControlButton)
oButton.Caption = "View Data..."
oButton.OnAction = "ViewData"
oButton.Tag = "ViewData"
End If

Which works fine. However, I want to control enabling / disabling it
dependent upon when the cell menu is shown (e.g. only if the selected cell is
valid for the action).

Is this possible in VBA for Excel 2002? If so, I cannot see where to add
the code to be run when this menu is displayed?


Thank you

Rob

 
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
enable/disable button based on cell value Shoney Excel Discussion (Misc queries) 3 January 9th 08 07:34 PM
Disable Menu (CommandBar) if not workbook is opened Ron de Bruin Excel Programming 2 December 27th 07 02:11 PM
Enable/Disable CommandBar Buttons Based on Events M. Authement Excel Programming 11 October 19th 06 02:46 AM
Toolbars Disable/Enable skrol Excel Programming 2 September 24th 05 04:45 PM
Disable CommandBar buttons while editing the cell Vinit[_2_] Excel Programming 1 August 16th 05 08:03 AM


All times are GMT +1. The time now is 12:01 PM.

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"