ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel Custom Made Toolbar (https://www.excelbanter.com/excel-programming/370416-excel-custom-made-toolbar.html)

drawlings[_4_]

Excel Custom Made Toolbar
 

Hi Guys,

Need to know if it is possible to enable/disable/hide/show certai
buttons on a custom toolbar I made

Thanks

Da

--
drawling
-----------------------------------------------------------------------
drawlings's Profile: http://www.excelforum.com/member.php...fo&userid=3662
View this thread: http://www.excelforum.com/showthread.php?threadid=57174


Norman Jones

Excel Custom Made Toolbar
 
Hi Dan,

Try something like:

'=============
Public Sub TesterA01()
Dim TBar As CommandBar

Set TBar = Application.CommandBars("YourToolbar") '<<==== CHANGE
TBar.Controls(1).Enabled = False

End Sub
'<<=============


--
---
Regards,
Norman



"drawlings" wrote
in message ...

Hi Guys,

Need to know if it is possible to enable/disable/hide/show certain
buttons on a custom toolbar I made

Thanks

Dan


--
drawlings
------------------------------------------------------------------------
drawlings's Profile:
http://www.excelforum.com/member.php...o&userid=36626
View this thread: http://www.excelforum.com/showthread...hreadid=571747




drawlings[_5_]

Excel Custom Made Toolbar
 

Thanks for your reply.

That code works great at disabling the toolbar itself, but I need to
disable certain buttons within the toolbar.

Example:

Toolbar Name: P&L
I have 6 buttons in total and I want to disable the second button
'Options'.
Button1 = Download
Button2 = Options

etc.....



Thanks

Dan


--
drawlings
------------------------------------------------------------------------
drawlings's Profile: http://www.excelforum.com/member.php...o&userid=36626
View this thread: http://www.excelforum.com/showthread...hreadid=571747


Norman Jones

Excel Custom Made Toolbar
 
Hi Dan,

That code works great at disabling the toolbar itself, but I need to
disable certain buttons within the toolbar.


The suggested code does not disable the custom toolbar; it disables only the
first control on the toolbar.



---
Regards,
Norman



drawlings[_6_]

Excel Custom Made Toolbar
 

Ok, so is there code to disable a button within a toolbar?


--
drawlings
------------------------------------------------------------------------
drawlings's Profile: http://www.excelforum.com/member.php...o&userid=36626
View this thread: http://www.excelforum.com/showthread...hreadid=571747


Norman Jones

Excel Custom Made Toolbar
 
Hi Dan,

Yes - try my suggested code.


---
Regards,
Norman



"drawlings" wrote
in message ...

Ok, so is there code to disable a button within a toolbar?


--
drawlings
------------------------------------------------------------------------
drawlings's Profile:
http://www.excelforum.com/member.php...o&userid=36626
View this thread: http://www.excelforum.com/showthread...hreadid=571747




drawlings[_9_]

Excel Custom Made Toolbar
 

Norman, thanks again for you reply but please see attachment, it will
explain it better


+-------------------------------------------------------------------+
|Filename: ExcelToobar.JPG |
|Download: http://www.excelforum.com/attachment.php?postid=5206 |
+-------------------------------------------------------------------+

--
drawlings
------------------------------------------------------------------------
drawlings's Profile: http://www.excelforum.com/member.php...o&userid=36626
View this thread: http://www.excelforum.com/showthread...hreadid=571747


Norman Jones

Excel Custom Made Toolbar
 
Hi Dan,

Try:

Application.CommandBars("YourToolBar"). _
Controls(1).Controls(1).Enabled = False

---
Regards,
Norman




All times are GMT +1. The time now is 03:39 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com