Add In Help

aru_aakash

Board Regular
Joined
May 22, 2009
Messages
74
Hello,

I was trying to add a procedure in Worksheet menu bar and wanted it to pass on to my colleagues through sharing of worksheet itself.

So i put following codes in a worksheet:

<Code>
Private Sub Workbook_Open()
On Error Resume Next
AddIns.Add ThisWorkbook.FullName
AddIns("InWordsRs").Installed = True
Application.CommandBars("Worksheet Menu Bar").Controls("InWordsRs").Delete
Set cControl = Application.CommandBars("Worksheet Menu Bar").Controls.Add
With cControl
.Caption = "InWordsRs"
.Style = msoButtonCaption
.OnAction = "aakash"
End With
On Error GoTo 0
End Sub
</Code>

I believed that for the commandbutton to add under "add-ins" tab, we just needed to open the workbook in which above codes are saved just once (Trigerring Workbook open event). However, once the excel is closed and again reopened, it adds one more command button with the same name (i.e "InWordsRs").

I am little confused about why this is happening. I will appreciate help from excel gurus.

2nd question : Is there any way of embedding a UDF in excel just like any other Excel's in-built function and if so how it could be done.


Many Thanks in advance
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

Forum statistics

Threads
1,214,784
Messages
6,121,536
Members
449,037
Latest member
tmmotairi

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