Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Tools For Office - Excel Menus
Using Tools for Office, does anyone know how to create Cascading menus (menus within menus) for Excel? Also does anyone know how to create right- click/context/short-cut menus (if it is possible) for Excel? Thanks. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Tools For Office - Excel Menus
Troy,
Are you talking about the Visual Studio Tools For Office? You create menu items there in very much the same way as you do in VBA. For example, Friend MenuCtrl As Office.CommandBarControl ' this goes on the Tools menu Private WithEvents MenuItem1 As Office.CommandBarButton 'this goes under the control Private WithEvents MenuItem2 As Office.CommandBarButton 'this goes under the control Try MenuCtrl = Me.ThisApplication.CommandBars.FindControl(ID:=cTO OLS_MENU).Contr ols.Add _ (Type:=Office.MsoControlType.msoControlPopup, temporary:=True) MenuCtrl.Tag = cMENU_TAG MenuCtrl.Caption = "Office NET Tools" MenuItem1 = MenuCtrl.Controls.Add() MenuItem1.Caption = "1. Show Modal Form" MenuItem1.Tag = cMENU_TAG MenuItem2 = MenuCtrl.Controls.Add() MenuItem2.Caption = "2. Show Modeless Form" MenuItem2.Tag = cMENU_TAG Catch ex As Exception MessageBox.Show ("Error creating menu items: " & vbCrLf & _ ex.Message) End Try You can custom the right-click menu by adding controls to the "Cell" menu. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Troy" wrote in message ... Using Tools for Office, does anyone know how to create Cascading menus (menus within menus) for Excel? Also does anyone know how to create right- click/context/short-cut menus (if it is possible) for Excel? Thanks. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Tools For Office - Excel Menus
Thanks. Excuse my ignorance, but how do you add the items to the "cell" menu (ie how do you get a handle on the "Cell" menu) Thanks again. -----Original Message----- Troy, Are you talking about the Visual Studio Tools For Office? You create menu items there in very much the same way as you do in VBA. For example, Friend MenuCtrl As Office.CommandBarControl ' this goes on the Tools menu Private WithEvents MenuItem1 As Office.CommandBarButton 'this goes under the control Private WithEvents MenuItem2 As Office.CommandBarButton 'this goes under the control Try MenuCtrl = Me.ThisApplication.CommandBars.FindControl (ID:=cTOOLS_MENU).Contr ols.Add _ (Type:=Office.MsoControlType.msoControlPopup, temporary:=True) MenuCtrl.Tag = cMENU_TAG MenuCtrl.Caption = "Office NET Tools" MenuItem1 = MenuCtrl.Controls.Add() MenuItem1.Caption = "1. Show Modal Form" MenuItem1.Tag = cMENU_TAG MenuItem2 = MenuCtrl.Controls.Add() MenuItem2.Caption = "2. Show Modeless Form" MenuItem2.Tag = cMENU_TAG Catch ex As Exception MessageBox.Show ("Error creating menu items: " & vbCrLf & _ ex.Message) End Try You can custom the right-click menu by adding controls to the "Cell" menu. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Troy" wrote in message ... Using Tools for Office, does anyone know how to create Cascading menus (menus within menus) for Excel? Also does anyone know how to create right- click/context/short-cut menus (if it is possible) for Excel? Thanks. . |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Tools For Office - Excel Menus
Troy,
Use Dim CmdBar As Office.CommandBar CmdBar = Me.ThisApplication.CommandBars("Cell") -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com wrote in message ... Thanks. Excuse my ignorance, but how do you add the items to the "cell" menu (ie how do you get a handle on the "Cell" menu) Thanks again. -----Original Message----- Troy, Are you talking about the Visual Studio Tools For Office? You create menu items there in very much the same way as you do in VBA. For example, Friend MenuCtrl As Office.CommandBarControl ' this goes on the Tools menu Private WithEvents MenuItem1 As Office.CommandBarButton 'this goes under the control Private WithEvents MenuItem2 As Office.CommandBarButton 'this goes under the control Try MenuCtrl = Me.ThisApplication.CommandBars.FindControl (ID:=cTOOLS_MENU).Contr ols.Add _ (Type:=Office.MsoControlType.msoControlPopup, temporary:=True) MenuCtrl.Tag = cMENU_TAG MenuCtrl.Caption = "Office NET Tools" MenuItem1 = MenuCtrl.Controls.Add() MenuItem1.Caption = "1. Show Modal Form" MenuItem1.Tag = cMENU_TAG MenuItem2 = MenuCtrl.Controls.Add() MenuItem2.Caption = "2. Show Modeless Form" MenuItem2.Tag = cMENU_TAG Catch ex As Exception MessageBox.Show ("Error creating menu items: " & vbCrLf & _ ex.Message) End Try You can custom the right-click menu by adding controls to the "Cell" menu. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Troy" wrote in message ... Using Tools for Office, does anyone know how to create Cascading menus (menus within menus) for Excel? Also does anyone know how to create right- click/context/short-cut menus (if it is possible) for Excel? Thanks. . |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Tools For Office - Excel Menus
You can custom the right-click menu by adding controls to the
"Cell" menu. I have created the control on the right-click menu which runs a macro for the selected cells. But this control is not available (control button fades up) when entire raws or column is selected. Code is as below. Sub My_Format() CommandBars("Cell").Reset With CommandBars("Cell") With .Controls.Add .FaceId = 20 .Caption = "My Format" .OnAction = "form" End With End With End Sub Thanks, Shetty |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Tools For Office - Excel Menus
Shetty,
The command bars shown when you select an entire row or column are called "Row" and "Column". You would have to add your controls to those command bars as well. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Shetty" wrote in message om... You can custom the right-click menu by adding controls to the "Cell" menu. I have created the control on the right-click menu which runs a macro for the selected cells. But this control is not available (control button fades up) when entire raws or column is selected. Code is as below. Sub My_Format() CommandBars("Cell").Reset With CommandBars("Cell") With .Controls.Add .FaceId = 20 .Caption = "My Format" .OnAction = "form" End With End With End Sub Thanks, Shetty |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Tools For Office - Excel Menus
Thanks Chip.
I have repeated the same statements with the row and column replacing cell and it works as expected. Thanks again. Shetty. "Chip Pearson" wrote in message ... Shetty, The command bars shown when you select an entire row or column are called "Row" and "Column". You would have to add your controls to those command bars as well. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Shetty" wrote in message om... You can custom the right-click menu by adding controls to the "Cell" menu. I have created the control on the right-click menu which runs a macro for the selected cells. But this control is not available (control button fades up) when entire raws or column is selected. Code is as below. Sub My_Format() CommandBars("Cell").Reset With CommandBars("Cell") With .Controls.Add .FaceId = 20 .Caption = "My Format" .OnAction = "form" End With End With End Sub Thanks, Shetty |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
where is toolsoptionsshow full menus in Excel 2007 | Excel Discussion (Misc queries) | |||
Office Button Customization - Hiding Menus - Excel 2007 | Excel Discussion (Misc queries) | |||
I have lost my menus and tools | Excel Discussion (Misc queries) | |||
Tools/office Links | Excel Discussion (Misc queries) | |||
Visual Studio Tools for Office- Excel | Excel Programming |