PDA

View Full Version : How to create the menu w/o the code as the attached file



lvd
07-02-2011, 08:41 AM
Dear All,

I have a file in the other forum. I do not know how they create the menu as I did not see any code to create the menu.

Tks,

lvl

Bob Phillips
07-02-2011, 09:32 AM
Why don't you ask them in that other forum?

Paul_Hossler
07-02-2011, 04:53 PM
I don't have access to 2003, but here's a reference

http://support.microsoft.com/kb/830502

Create a custom command control on a menu

The following example code creates a new command that is named Custom1 on the Tools menu of the Worksheet menu bar, and then runs the Code_Custom1 macro when you click Custom1:


Sub menuItem_Create()
With CommandBars("Worksheet menu bar").Controls("Tools")
.Controls.Add(Type:=msoControlButton, Before:=1).Caption = "Custom1"
.Controls("Custom1").OnAction = "Code_Custom1"
End With
End Sub


2007/2010 still work with CommandBars, but I don't really remember how to create thenPaul

lvd
07-02-2011, 08:35 PM
Why don't you ask them in that other forum?
Hi xld,
The owner do not want to ans.

lvl

lvd
07-02-2011, 08:37 PM
2007/2010 still work with CommandBars, but I don't really remember how to create then
Paul
Thanks Paul,

As you see the code in the file, there is no any code to create the menu.
Then how they can create the menu when you open it, that is the thing I want to find the ans.

lvl

mohanvijay
07-03-2011, 08:39 PM
See attached file

lvd
07-03-2011, 09:40 PM
Hi mohanvijay,

As you can see the attached file that there is no any code like:
Application.CommandBars(1).Controls.Add

I want to find out how they add this w/o the code.
Tks,

lvl

lvd
07-07-2011, 06:53 PM
Hi,
I have found out how to do this with Macro 4.
Tks,

lvl

lvd
07-07-2011, 06:55 PM
Hi,

I have found out how to create this menu with macro 4.

lvl

How can I could not remove this file. Mod, pls help me to remove this file. Tks,

lvl

Aussiebear
07-07-2011, 09:03 PM
Why do you want the file removed?

lvd
07-12-2011, 10:04 PM
Hi Aussiebear,

I want to removed because I have found out the solution.
Tks,

lvd

Aussiebear
07-15-2011, 12:04 AM
Since you have asked a question on a public forum, then why not supply the answer as well?

For example is this the solution you found?


Thanks, I have found out how to create this menu and hide it.
1. Insert the MS Excel 4.0 Macro
2. Write the code here. We can use AutoOpen to do something when this workbook open
3. Create the menu by using macro 4.0 with the command: =ADD.MENU(10,Mymenu)
4. Set password to protect this MS Excel 4.0 Macro sheet.
5. Run the code to hide this MS Excel 4.0 Macro sheet.

It's so easy, why I do not think about the macro 4 before raise the question.

CatDaddy
07-15-2011, 04:31 PM
just rude...

Aussiebear
07-15-2011, 06:52 PM
I want to removed because I have found out the solution.


Sorry but that's not a good enough reason to remove this thread. It will stay public so that others may use the experience to learn from.