Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 169
Default Custom commandbar, submenu questions

1. When I added the code below to a test menu, the triangle that pops up
next to "Error" (to indicate a submenu) in the main menu shows up on the line
below the text rather than on the same line as the text. I'm sure there is
something simple that I am missing. Any ideas

2. In the sub Check_Errors, I want to enable the "Review Errors" menu item,
but cannot figure out the correct syntax to enable a submenus control.

Set CmdBarSub = CmdBar.Controls.Add(Type:=msoControlPopup)
With ctrl
.Caption = "Error"
End With

Set ctrl = CmdBarSub.Controls.Add(Type:=msoControlButton)
With ctrl
.Caption = "Check Errors"
.OnAction = "Check_Errors"
End With
Set ctrl = CmdBarSub.Controls.Add(Type:=msoControlButton)
With ctrl
.Caption = "Review Errors"
.OnAction = "Review_Errors"
.Enabled = False
End With

--
Don''t forget to rate the post if it was helpful!

Email address is not valid.
Please reply to newsgroup only.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Custom commandbar, submenu questions

I do not see the first problem.

Re enabling the control later. If you assign a Tag to the control you use
it later:

Assign Tag property:

With ctrl
.Caption = "Review Errors"
.OnAction = "Review_Errors"
.Enabled = False
.Tag = "RevErrors"
End With

and later:

CommandBars.FindControl(Tag:="RevErrors").Enabled = True

--
Jim
"Dale Fye" wrote in message
...
| 1. When I added the code below to a test menu, the triangle that pops up
| next to "Error" (to indicate a submenu) in the main menu shows up on the
line
| below the text rather than on the same line as the text. I'm sure there
is
| something simple that I am missing. Any ideas
|
| 2. In the sub Check_Errors, I want to enable the "Review Errors" menu
item,
| but cannot figure out the correct syntax to enable a submenus control.
|
| Set CmdBarSub = CmdBar.Controls.Add(Type:=msoControlPopup)
| With ctrl
| .Caption = "Error"
| End With
|
| Set ctrl = CmdBarSub.Controls.Add(Type:=msoControlButton)
| With ctrl
| .Caption = "Check Errors"
| .OnAction = "Check_Errors"
| End With
| Set ctrl = CmdBarSub.Controls.Add(Type:=msoControlButton)
| With ctrl
| .Caption = "Review Errors"
| .OnAction = "Review_Errors"
| .Enabled = False
| End With
|
| --
| Don''t forget to rate the post if it was helpful!
|
| Email address is not valid.
| Please reply to newsgroup only.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 169
Default Custom commandbar, submenu questions

Worked like a charm. Thanks.
--
Don''t forget to rate the post if it was helpful!

Email address is not valid.
Please reply to newsgroup only.


"Jim Rech" wrote:

I do not see the first problem.

Re enabling the control later. If you assign a Tag to the control you use
it later:

Assign Tag property:

With ctrl
.Caption = "Review Errors"
.OnAction = "Review_Errors"
.Enabled = False
.Tag = "RevErrors"
End With

and later:

CommandBars.FindControl(Tag:="RevErrors").Enabled = True

--
Jim
"Dale Fye" wrote in message
...
| 1. When I added the code below to a test menu, the triangle that pops up
| next to "Error" (to indicate a submenu) in the main menu shows up on the
line
| below the text rather than on the same line as the text. I'm sure there
is
| something simple that I am missing. Any ideas
|
| 2. In the sub Check_Errors, I want to enable the "Review Errors" menu
item,
| but cannot figure out the correct syntax to enable a submenus control.
|
| Set CmdBarSub = CmdBar.Controls.Add(Type:=msoControlPopup)
| With ctrl
| .Caption = "Error"
| End With
|
| Set ctrl = CmdBarSub.Controls.Add(Type:=msoControlButton)
| With ctrl
| .Caption = "Check Errors"
| .OnAction = "Check_Errors"
| End With
| Set ctrl = CmdBarSub.Controls.Add(Type:=msoControlButton)
| With ctrl
| .Caption = "Review Errors"
| .OnAction = "Review_Errors"
| .Enabled = False
| End With
|
| --
| Don''t forget to rate the post if it was helpful!
|
| Email address is not valid.
| Please reply to newsgroup only.



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
How to Place a Check Mark Next to an Item in the Submenu of a Custom Menu Evil Bumblebee Excel Programming 1 July 9th 07 03:54 PM
custom commandbar questions ckoch Excel Programming 1 February 12th 06 08:53 AM
Custom Commandbar Stefano Condotta Excel Programming 2 March 3rd 05 07:00 PM
Value of ComboBox on Custom CommandBar Kevin Excel Programming 4 January 15th 04 10:25 PM
Add submenu to custom menu Excel[_3_] Excel Programming 1 July 23rd 03 08:07 AM


All times are GMT +1. The time now is 09:47 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"