Hi,
I have made some macro and now want to add a Popup button for it in the Main Menu bar.
I tried below code, but this is not working.
Set cbMainMenuBar = Application.CommandBars("Worksheet Menu Bar").Controls("Tools")
Set cbcCutomMenu = cbMainMenuBar.Controls.Add(Type:=msoControlPopup, Before:=5)
cbcCutomMenu.Caption = "My_Macro"
though when i am trying to add a Popup button directly to Main Menu bar that's working with below code.
Set cbMainMenuBar = Application.CommandBars("Worksheet Menu Bar")
Set cbcCutomMenu = cbMainMenuBar.Controls.Add(Type:=msoControlPopup, Before:=5)
cbcCutomMenu.Caption = "My_Macro"
can anyone suggest me how can I add My_Macro button to the Tools Menu in Main Menu Bar.
Regards
Premanshu.
I have made some macro and now want to add a Popup button for it in the Main Menu bar.
I tried below code, but this is not working.
Set cbMainMenuBar = Application.CommandBars("Worksheet Menu Bar").Controls("Tools")
Set cbcCutomMenu = cbMainMenuBar.Controls.Add(Type:=msoControlPopup, Before:=5)
cbcCutomMenu.Caption = "My_Macro"
though when i am trying to add a Popup button directly to Main Menu bar that's working with below code.
Set cbMainMenuBar = Application.CommandBars("Worksheet Menu Bar")
Set cbcCutomMenu = cbMainMenuBar.Controls.Add(Type:=msoControlPopup, Before:=5)
cbcCutomMenu.Caption = "My_Macro"
can anyone suggest me how can I add My_Macro button to the Tools Menu in Main Menu Bar.
Regards
Premanshu.