Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default 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   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default 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
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
where is toolsoptionsshow full menus in Excel 2007 pattyb Excel Discussion (Misc queries) 5 December 9th 08 12:50 AM
Office Button Customization - Hiding Menus - Excel 2007 marcnz Excel Discussion (Misc queries) 1 January 25th 07 03:16 PM
I have lost my menus and tools Lina Excel Discussion (Misc queries) 3 November 25th 05 01:26 PM
Tools/office Links teddkilroy Excel Discussion (Misc queries) 1 October 14th 05 07:34 PM
Visual Studio Tools for Office- Excel Manoj[_3_] Excel Programming 1 October 14th 03 02:46 PM


All times are GMT +1. The time now is 05:17 AM.

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"