Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 553
Default PRoblem with Menu Set up

I have a xla menu that I am trying to set up upon start up. It is failing
ont the line of code:

Set MySubMenu1 = MyMenu.Controls.Add(Type:=msoControlButton, ID:=1,
Temporary:=True)

If I change the "msoControlButton" to "msoControlPopup" it works. Problem
is the menue item has little black arrow implying there are sub menus.
Since there aren't, I do no want to show the black arrows. I have used
msoControlButton before and it worked. Is it failing because of the way I
have dimeneioned MySubMenu1?

Sub MenuSetup()
Dim GTMenuBar As CommandBar
Dim MyMenu
Dim MySubMenu1 As CommandBarPopup
Dim MyControl As CommandBarButton
Dim MyButton As CommandBarButton


Set GTMenuBar = CommandBars.ActiveMenuBar

Set MyMenu = GTMenuBar.Controls.Add(Type:=msoControlPopup, Temporary:=True)
MyMenu.Caption = "&PF Tools"
'MyMenu.BeginGroup = True

'******
'Create First Menu Item
Set MySubMenu1 = MyMenu.Controls.Add(Type:=msoControlButton, ID:=1,
Temporary:=True)
MySubMenu1.Caption = "My Program"
MySubMenu1.OnAction = "BigCode"


Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 553
Default PRoblem with Menu Set up

I needed to dim Dim MySubMenu1 As CommandBarButton Not CommandBarPopup!



"ExcelMonkey" wrote:

I have a xla menu that I am trying to set up upon start up. It is failing
ont the line of code:

Set MySubMenu1 = MyMenu.Controls.Add(Type:=msoControlButton, ID:=1,
Temporary:=True)

If I change the "msoControlButton" to "msoControlPopup" it works. Problem
is the menue item has little black arrow implying there are sub menus.
Since there aren't, I do no want to show the black arrows. I have used
msoControlButton before and it worked. Is it failing because of the way I
have dimeneioned MySubMenu1?

Sub MenuSetup()
Dim GTMenuBar As CommandBar
Dim MyMenu
Dim MySubMenu1 As CommandBarPopup
Dim MyControl As CommandBarButton
Dim MyButton As CommandBarButton


Set GTMenuBar = CommandBars.ActiveMenuBar

Set MyMenu = GTMenuBar.Controls.Add(Type:=msoControlPopup, Temporary:=True)
MyMenu.Caption = "&PF Tools"
'MyMenu.BeginGroup = True

'******
'Create First Menu Item
Set MySubMenu1 = MyMenu.Controls.Add(Type:=msoControlButton, ID:=1,
Temporary:=True)
MySubMenu1.Caption = "My Program"
MySubMenu1.OnAction = "BigCode"


Thanks

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 124
Default PRoblem with Menu Set up

Thanks for sharing the solution! Others will benefit from it.

Btw, may I ask why you use the Temporary status like you do?

--
Regards,
Zack Barresse, aka firefytr, (GT = TFS FF Zack)


"ExcelMonkey" wrote in message
...
I needed to dim Dim MySubMenu1 As CommandBarButton Not CommandBarPopup!



"ExcelMonkey" wrote:

I have a xla menu that I am trying to set up upon start up. It is
failing
ont the line of code:

Set MySubMenu1 = MyMenu.Controls.Add(Type:=msoControlButton, ID:=1,
Temporary:=True)

If I change the "msoControlButton" to "msoControlPopup" it works.
Problem
is the menue item has little black arrow implying there are sub menus.
Since there aren't, I do no want to show the black arrows. I have used
msoControlButton before and it worked. Is it failing because of the way
I
have dimeneioned MySubMenu1?

Sub MenuSetup()
Dim GTMenuBar As CommandBar
Dim MyMenu
Dim MySubMenu1 As CommandBarPopup
Dim MyControl As CommandBarButton
Dim MyButton As CommandBarButton


Set GTMenuBar = CommandBars.ActiveMenuBar

Set MyMenu = GTMenuBar.Controls.Add(Type:=msoControlPopup,
Temporary:=True)
MyMenu.Caption = "&PF Tools"
'MyMenu.BeginGroup = True

'******
'Create First Menu Item
Set MySubMenu1 = MyMenu.Controls.Add(Type:=msoControlButton, ID:=1,
Temporary:=True)
MySubMenu1.Caption = "My Program"
MySubMenu1.OnAction = "BigCode"


Thanks



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 553
Default PRoblem with Menu Set up

What do you mean by temporary status?

"Zack Barresse" wrote:

Thanks for sharing the solution! Others will benefit from it.

Btw, may I ask why you use the Temporary status like you do?

--
Regards,
Zack Barresse, aka firefytr, (GT = TFS FF Zack)


"ExcelMonkey" wrote in message
...
I needed to dim Dim MySubMenu1 As CommandBarButton Not CommandBarPopup!



"ExcelMonkey" wrote:

I have a xla menu that I am trying to set up upon start up. It is
failing
ont the line of code:

Set MySubMenu1 = MyMenu.Controls.Add(Type:=msoControlButton, ID:=1,
Temporary:=True)

If I change the "msoControlButton" to "msoControlPopup" it works.
Problem
is the menue item has little black arrow implying there are sub menus.
Since there aren't, I do no want to show the black arrows. I have used
msoControlButton before and it worked. Is it failing because of the way
I
have dimeneioned MySubMenu1?

Sub MenuSetup()
Dim GTMenuBar As CommandBar
Dim MyMenu
Dim MySubMenu1 As CommandBarPopup
Dim MyControl As CommandBarButton
Dim MyButton As CommandBarButton


Set GTMenuBar = CommandBars.ActiveMenuBar

Set MyMenu = GTMenuBar.Controls.Add(Type:=msoControlPopup,
Temporary:=True)
MyMenu.Caption = "&PF Tools"
'MyMenu.BeginGroup = True

'******
'Create First Menu Item
Set MySubMenu1 = MyMenu.Controls.Add(Type:=msoControlButton, ID:=1,
Temporary:=True)
MySubMenu1.Caption = "My Program"
MySubMenu1.OnAction = "BigCode"


Thanks




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 124
Default PRoblem with Menu Set up

In your code, you have your Commandbar [Popup] Temporary status set to True.
It's Boolean, either True or False. ...

Set MySubMenu1 = MyMenu.Controls.Add(type:=msoControlButton, ID:=1,
Temporary:=True)

I was just curious as to the reason you had it set to True.

--
Regards,
Zack Barresse, aka firefytr, (GT = TFS FF Zack)



"ExcelMonkey" wrote in message
...
What do you mean by temporary status?

"Zack Barresse" wrote:

Thanks for sharing the solution! Others will benefit from it.

Btw, may I ask why you use the Temporary status like you do?

--
Regards,
Zack Barresse, aka firefytr, (GT = TFS FF Zack)


"ExcelMonkey" wrote in message
...
I needed to dim Dim MySubMenu1 As CommandBarButton Not CommandBarPopup!



"ExcelMonkey" wrote:

I have a xla menu that I am trying to set up upon start up. It is
failing
ont the line of code:

Set MySubMenu1 = MyMenu.Controls.Add(Type:=msoControlButton, ID:=1,
Temporary:=True)

If I change the "msoControlButton" to "msoControlPopup" it works.
Problem
is the menue item has little black arrow implying there are sub
menus.
Since there aren't, I do no want to show the black arrows. I have
used
msoControlButton before and it worked. Is it failing because of the
way
I
have dimeneioned MySubMenu1?

Sub MenuSetup()
Dim GTMenuBar As CommandBar
Dim MyMenu
Dim MySubMenu1 As CommandBarPopup
Dim MyControl As CommandBarButton
Dim MyButton As CommandBarButton


Set GTMenuBar = CommandBars.ActiveMenuBar

Set MyMenu = GTMenuBar.Controls.Add(Type:=msoControlPopup,
Temporary:=True)
MyMenu.Caption = "&PF Tools"
'MyMenu.BeginGroup = True

'******
'Create First Menu Item
Set MySubMenu1 = MyMenu.Controls.Add(Type:=msoControlButton, ID:=1,
Temporary:=True)
MySubMenu1.Caption = "My Program"
MySubMenu1.OnAction = "BigCode"


Thanks








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
problem with custom menu Tony Excel Programming 4 May 3rd 05 02:27 PM
MENU Problem tony moody Excel Programming 0 September 18th 04 05:32 PM
MENU Problem TAM Excel Programming 0 September 18th 04 03:00 PM
Menu problem [email protected] Excel Programming 0 October 23rd 03 01:53 AM


All times are GMT +1. The time now is 07:33 PM.

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"