How to add a Custom menu TAB for Seperate work book

selvamariappan

New Member
Joined
Feb 16, 2012
Messages
39
Dear all,

Can any one help me on this, :(

I need to add a own menu tab and its option or button for seperate work book which should not be visible in other workbook.

FYI : I am using excel 2010 and the excel file is macro enabled file(.xlsm)

Please help me on this.Its urgent.:confused:

Regards,
Selva.C
 
Hello,

Thanks for your support, I have created a menu in my single workbook with your link.

But my problem is not solved, i have three sheets in my workbook, i have written my macro in sheet2 page.
my macro function is

Public function sample()
msgbox " test"
End function

I need to call this sample() function in my newly created module.

I have tried the code as

Sub Macro1(control As IRibbonControl)
Call Application.WorksheetFunction.sample
End Sub

But i am getting error as : Run time error : '438'
Object doesn't support this property or method :(

Please help me , how to call my sheet function in my module.

Thanks in advance.

This is will end my all problem.:)
 
Upvote 0

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
sample is not a member of worksheetfunction - it's a function you created, so it's just:
Code:
Call sample
 
Upvote 0
Thanks for your kind reply,

If i use just call , it showing error as

"Compile error:
Sub or Function not defined"

Please what is error in my code.
 
Upvote 0
Sorry - I missed that you had put in a worksheet module for some reason. You need:
Code:
Call sheet2.sample
 
Upvote 0
Oh thats great and good , its working fine,

sorry,sorry one more prob/doubt

It's calling my function sample, but i have called another function within that sample function , but it show error as
"Compile error:Variable not defined"

My code in sheet 2 is

Public function sample()
dim OuterloopRow as Integer
OuterloopRow=2

Sheet2.calcul row1:=OuterloopRow
End function

Public function calcul (ByVal row1 As Integer)
msgbox "test"
End function

Please assist.
 
Upvote 0
Thanks a lot for your all support till this time,

Its my mistake and i have tried to use a variable from one function to another function , finally I have declared it as global variable and works fine what i expected.

Every thing work for me.:biggrin:

"Expert makes perfect" :)

"Thanks a lot for your great support towards the end, especially with lot of patience.":beerchug:

Regards,
Selva.C
 
Upvote 0
Hello,

Sorry for disturbing,

Onemore problem,I have created a single menu and with an option and i am using excel 2010.Its working what i expected in excel 2010,.

Note : when i open that file in 2010 , it will ask for Protected view : need to edit click here like that.

But when i tried to open it through 2007 in other system, i am not getting that menu in my tab list.

Please help me,
 
Upvote 0
how did you add the menu? did you use a customui14 part?
 
Upvote 0

Forum statistics

Threads
1,223,713
Messages
6,174,043
Members
452,542
Latest member
Bricklin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top