Thread: Excel Add-In
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
mju mju is offline
external usenet poster
 
Posts: 29
Default Excel Add-In

Thanks alot Sam!

It works perfectly fine when i open an excel file (xls) but the macro does
not run when i open a csv file in excel. it tells me the macro cannot be
found.


"Sam Wilson" wrote:

Save the add-in to a shared location - users can go to tools/add-ins and
browse to your add-in, copying a copy to their C drive when prompted.


To create a menu, use something like the following in the workbook open event:

On Error Resume Next
Application.CommandBars("Worksheet Menu Bar").Controls("My Menu").Delete
On Error GoTo 0

Dim wsmb As CommandBar
Dim myMen As CommandBarControl

Set wsmb = Application.CommandBars("Worksheet Menu Bar")
Set myMen = wsmb.Controls.Add(Type:=msoControlPopup, temporary:=True)

With myMen
.Caption = "My Menu"
With .Controls.Add(msoControlButton)
.Caption = "First menu option"
.OnAction = "{macro name}"
End With
With .Controls.Add(msoControlButton)
.Caption = "Second menu option"
.OnAction = "{macro name}"
End With
end with

"mju" wrote:

I just created an excel add-in . I want my users to be able to add it to
their workbook or it should always be there whenever excel workbook is
opened. €¦ Something like the personal workbook.

Also, how do I make it available for the macro to run without the user going
through the VB editor to run the macro? Something like going through the
tools-macro-choose macro name €“run or maybe a custom button on the menu or
toolbar

thanks