Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create Excel Addin 1

Status
Not open for further replies.

ufobaby

MIS
Sep 25, 2001
238
US
hi, experts

Would want to know how to create Excel Addin , which will create a short cut on the menu bar or the toolbar etc... so i donot have to bother abt doing that on each user machine and can disribute my code for commonly use macros.

Thanks in advance.....

Regards
Niraj [noevil]
 
save your workbook as Microsoft Excel Addin it's in the "Save as" dialog box drop down,.. at the end maybe,..it should default to the AddIns folder when selected after it is saved ...it will then be available from the addins menu as a check box item.
 
That creates the Addin but to add a shortcut on the menu bar you can add this code to the WorkBook_open event.

Dim toolsMenu As CommandBarPopup
Dim NewMenuItem As CommandBarButton
Dim i As Integer
Dim x As Integer

Set toolsMenu = CommandBars(1).FindControl(Id:=30007)
x = toolsMenu.Controls.Count

For i = 1 To x
If toolsMenu.Controls.Item(i).Caption = "AppName" Then
'Already Added
Exit Sub
End If
Next

Set NewMenuItem = toolsMenu.Controls.Add(Type:=msoControlButton)

With NewMenuItem
.Caption = "AppName"
.FaceId = 348 'There are lots of different designs. Change the number to suit
.OnAction = "OpenForm" 'Action that you want to perform
End With



Hope this helps Matt Smith

No two nulls are the same
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top