Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Tag in CommandBar


Hi all,

I have read help etc. but i'm still in the dark. Could someone explai
to me the
uses for "Tag" when dealing with Command Bars?
IE:
'.Tag =
'.Caption =
'.OnAction =
'.Parameter =
'.FaceId =
'.Style =
'.BeginGroup =
'.TooltipText

--
Desert Piranh

-----------------------------------------------------------------------
Desert Piranha's Profile: http://www.excelforum.com/member.php...fo&userid=2893
View this thread: http://www.excelforum.com/showthread.php?threadid=56972

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Tag in CommandBar

Hi Desert

Here is a example that add a control to the Cell menu
(When you right click on a cell)

Sub AddToCellDropDown()
Dim CellDropDown As CommandBar
Dim MyDropDownItem As CommandBarControl

RemoveFromCellDropDown

Set CellDropDown = Application.CommandBars("Cell")
With CellDropDown.Controls.Add(Type:=msoControlButton, befo=1)
.Caption = "Try me"
.Style = msoButtonIconAndCaption
.FaceId = 59
.OnAction = ThisWorkbook.Name & "!Your_macro"
.Tag = "MyDropDownItem"
End With
End Sub

Sub RemoveFromCellDropDown()
Dim MyDropDownItem As CommandBarControl
Set MyDropDownItem = Application.CommandBars.FindControl(Tag:="MyDropDo wnItem")
If Not MyDropDownItem Is Nothing Then
MyDropDownItem.Delete
End If
Set MyDropDownItem = Nothing
End Sub

Sub Your_macro()
MsgBox "Hi there."
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Desert Piranha" <Desert.Piranha.2c92dv_1155088510.2116@excelforu m-nospam.com wrote in message
news:Desert.Piranha.2c92dv_1155088510.2116@excelfo rum-nospam.com...

Hi all,

I have read help etc. but i'm still in the dark. Could someone explain
to me the
uses for "Tag" when dealing with Command Bars?
IE:
'.Tag =
'.Caption =
'.OnAction =
'.Parameter =
'.FaceId =
'.Style =
'.BeginGroup =
'.TooltipText =


--
Desert Piranha


------------------------------------------------------------------------
Desert Piranha's Profile: http://www.excelforum.com/member.php...o&userid=28934
View this thread: http://www.excelforum.com/showthread...hreadid=569722



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Tag in CommandBar


Hi Ron,

Thanks for your input here,

So as i can see the "Tag" is just kinda like a Name for the command
Bar. Right?

So it is another way of doing this:

'Delete Command Bar
Application.CommandBars("cell").Controls("Try me").Delete
or
'Makes Command Bar temporary
With .Controls.Add(Type:=msoControlButton, temporary:=True)

And "Tag" will work with any kind of Command Bars?

And would there be any other uses for "Tag" other than deleting the
Command Bar?

Thx
Dave
Ron de Bruin Wrote:
Hi Desert

Here is a example that add a control to the Cell menu
(When you right click on a cell)

Sub AddToCellDropDown()
Dim CellDropDown As CommandBar
Dim MyDropDownItem As CommandBarControl

RemoveFromCellDropDown

Set CellDropDown = Application.CommandBars("Cell")
With CellDropDown.Controls.Add(Type:=msoControlButton, befo=1)
.Caption = "Try me"
.Style = msoButtonIconAndCaption
.FaceId = 59
.OnAction = ThisWorkbook.Name & "!Your_macro"
.Tag = "MyDropDownItem"
End With
End Sub

Sub RemoveFromCellDropDown()
Dim MyDropDownItem As CommandBarControl
Set MyDropDownItem =
Application.CommandBars.FindControl(Tag:="MyDropDo wnItem")
If Not MyDropDownItem Is Nothing Then
MyDropDownItem.Delete
End If
Set MyDropDownItem = Nothing
End Sub

Sub Your_macro()
MsgBox "Hi there."
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Desert Piranha"
<Desert.Piranha.2c92dv_1155088510.2116@excelforu m-nospam.com wrote in
message
news:Desert.Piranha.2c92dv_1155088510.2116@excelfo rum-nospam.com...

Hi all,

I have read help etc. but i'm still in the dark. Could someone

explain
to me the
uses for "Tag" when dealing with Command Bars?
IE:
'.Tag =
'.Caption =
'.OnAction =
'.Parameter =
'.FaceId =
'.Style =
'.BeginGroup =
'.TooltipText =


--
Desert Piranha



------------------------------------------------------------------------
Desert Piranha's Profile:

http://www.excelforum.com/member.php...o&userid=28934
View this thread:

http://www.excelforum.com/showthread...hreadid=569722



--
Desert Piranha


------------------------------------------------------------------------
Desert Piranha's Profile: http://www.excelforum.com/member.php...o&userid=28934
View this thread: http://www.excelforum.com/showthread...hreadid=569722

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Tag in CommandBar

Hi

I use it only for this but you can als use Enabled = False for example
Look on the MSDN site for more info

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Desert Piranha" <Desert.Piranha.2c9zpi_1155131762.0566@excelforu m-nospam.com wrote in message
news:Desert.Piranha.2c9zpi_1155131762.0566@excelfo rum-nospam.com...

Hi Ron,

Thanks for your input here,

So as i can see the "Tag" is just kinda like a Name for the command
Bar. Right?

So it is another way of doing this:

'Delete Command Bar
Application.CommandBars("cell").Controls("Try me").Delete
or
'Makes Command Bar temporary
With .Controls.Add(Type:=msoControlButton, temporary:=True)

And "Tag" will work with any kind of Command Bars?

And would there be any other uses for "Tag" other than deleting the
Command Bar?

Thx
Dave
Ron de Bruin Wrote:
Hi Desert

Here is a example that add a control to the Cell menu
(When you right click on a cell)

Sub AddToCellDropDown()
Dim CellDropDown As CommandBar
Dim MyDropDownItem As CommandBarControl

RemoveFromCellDropDown

Set CellDropDown = Application.CommandBars("Cell")
With CellDropDown.Controls.Add(Type:=msoControlButton, befo=1)
.Caption = "Try me"
.Style = msoButtonIconAndCaption
.FaceId = 59
.OnAction = ThisWorkbook.Name & "!Your_macro"
.Tag = "MyDropDownItem"
End With
End Sub

Sub RemoveFromCellDropDown()
Dim MyDropDownItem As CommandBarControl
Set MyDropDownItem =
Application.CommandBars.FindControl(Tag:="MyDropDo wnItem")
If Not MyDropDownItem Is Nothing Then
MyDropDownItem.Delete
End If
Set MyDropDownItem = Nothing
End Sub

Sub Your_macro()
MsgBox "Hi there."
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Desert Piranha"
<Desert.Piranha.2c92dv_1155088510.2116@excelforu m-nospam.com wrote in
message
news:Desert.Piranha.2c92dv_1155088510.2116@excelfo rum-nospam.com...

Hi all,

I have read help etc. but i'm still in the dark. Could someone

explain
to me the
uses for "Tag" when dealing with Command Bars?
IE:
'.Tag =
'.Caption =
'.OnAction =
'.Parameter =
'.FaceId =
'.Style =
'.BeginGroup =
'.TooltipText =


--
Desert Piranha



------------------------------------------------------------------------
Desert Piranha's Profile:

http://www.excelforum.com/member.php...o&userid=28934
View this thread:

http://www.excelforum.com/showthread...hreadid=569722



--
Desert Piranha


------------------------------------------------------------------------
Desert Piranha's Profile: http://www.excelforum.com/member.php...o&userid=28934
View this thread: http://www.excelforum.com/showthread...hreadid=569722



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Tag in CommandBar


Hi Ron,

Thanks much, for the input. I think i got it figured out.

Thx again
Dave

[Ron de Bruin]Hi

I use it only for this but you can als use Enabled = False for example
Look on the MSDN site for more info

--
Regards Ron de Bruin
http://www.rondebruin.nl



"Desert Piranha"
<Desert.Piranha.2c9zpi_1155131762.0566@excelforu m-nospam.com wrote in
message
news:Desert.Piranha.2c9zpi_1155131762.0566@excelfo rum-nospam.com...

Hi Ron,

Thanks for your input here,

So as i can see the "Tag" is just kinda like a Name for the command
Bar. Right?

So it is another way of doing this:

'Delete Command Bar
Application.CommandBars("cell").Controls("Try me").Delete
or
'Makes Command Bar temporary
With .Controls.Add(Type:=msoControlButton, temporary:=True)

And "Tag" will work with any kind of Command Bars?

And would there be any other uses for "Tag" other than deleting the
Command Bar?

Thx
Dave
Ron de Bruin Wrote:
Hi Desert

Here is a example that add a control to the Cell menu
(When you right click on a cell)

Sub AddToCellDropDown()
Dim CellDropDown As CommandBar
Dim MyDropDownItem As CommandBarControl

RemoveFromCellDropDown

Set CellDropDown = Application.CommandBars("Cell")
With CellDropDown.Controls.Add(Type:=msoControlButton, befo=1)
.Caption = "Try me"
.Style = msoButtonIconAndCaption
.FaceId = 59
.OnAction = ThisWorkbook.Name & "!Your_macro"
.Tag = "MyDropDownItem"
End With
End Sub

Sub RemoveFromCellDropDown()
Dim MyDropDownItem As CommandBarControl
Set MyDropDownItem =
Application.CommandBars.FindControl(Tag:="MyDropDo wnItem")
If Not MyDropDownItem Is Nothing Then
MyDropDownItem.Delete
End If
Set MyDropDownItem = Nothing
End Sub

Sub Your_macro()
MsgBox "Hi there."
End Sub


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Desert Piranha"
<Desert.Piranha.2c92dv_1155088510.2116@excelforu m-nospam.com wrote

in
message
news:Desert.Piranha.2c92dv_1155088510.2116@excelfo rum-nospam.com...

Hi all,

I have read help etc. but i'm still in the dark. Could someone

explain
to me the
uses for "Tag" when dealing with Command Bars?
IE:
'.Tag =
'.Caption =
'.OnAction =
'.Parameter =
'.FaceId =
'.Style =
'.BeginGroup =
'.TooltipText =


--
Desert Piranha




------------------------------------------------------------------------
Desert Piranha's Profile:

http://www.excelforum.com/member.php...o&userid=28934
View this thread:

http://www.excelforum.com/showthread...hreadid=569722



--
Desert Piranha



------------------------------------------------------------------------
Desert Piranha's Profile:

http://www.excelforum.com/member.php...o&userid=28934
View this thread:

http://www.excelforum.com/showthread...hreadid=569722



--
Desert Piranha


------------------------------------------------------------------------
Desert Piranha's Profile: http://www.excelforum.com/member.php...o&userid=28934
View this thread: http://www.excelforum.com/showthread...hreadid=569722

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
cant dim as commandbar Seren Excel Programming 1 December 21st 05 09:18 PM
Commandbar Positioning PosseJohn Excel Programming 4 December 13th 05 10:30 PM
commandbar management me[_9_] Excel Programming 1 November 15th 05 05:13 PM
CommandBar swiederkehr Excel Programming 5 July 19th 05 04:58 PM
commandbar Greg Prost[_2_] Excel Programming 2 November 21st 03 11:42 AM


All times are GMT +1. The time now is 07:38 AM.

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

About Us

"It's about Microsoft Excel"