Re: AddIns



Dave,

Hi ...

I meant the latter - adding it to the bottom of the tools drop down, and you
have answered the question. I was under the mistaken impression that the
add-in should automatically appear there once I opened (checked) it. Now I
realize I need to write some code to make it happen.

Thanks to both you and Kassie for your very useful assistance.

"Dave Peterson" wrote:

> Do you mean in the tools|macro|macros dialog?
>
> If yes, then Kassie has one solution.
>
> If you meant you wanted it added to the bottom of the Tools dropdown, you have
> to put it there.
>
> One way is via code kind of like this:
>
> Option Explicit
> Sub auto_open()
>
> Dim ctrl As CommandBarControl
>
> On Error Resume Next
> Application.CommandBars("work*** menu bar") _
> .Controls("tools").Controls("Hi There").Delete
> On Error GoTo 0
>
> Set ctrl = Application.CommandBars("work*** menu bar") _
> .Controls("Tools").Controls.Add(temporary:=True)
>
> With ctrl
> .Caption = "Hi There"
> .OnAction = ThisWorkbook.Name & "!MyMacro"
> End With
>
> End Sub
> Sub auto_close()
> On Error Resume Next
> Application.CommandBars("work*** menu bar") _
> .Controls("tools").Controls("Hi There").Delete
> On Error GoTo 0
> End Sub
> Sub myMacro()
> MsgBox "Hi, from myMacro"
> End Sub
>
>
>
> ==========
> If you get lots of macros, you may want to use something like:
>
> If you want to give the user a nicer interface to run your macros...
>
> John Walkenbach's menumaker:
> http://j-walk.com/ss/excel/tips/tip53.htm
> to add items to the work*** menubar.
>
> If I want to add a toolbar of my own, here's how I do it:
> http://groups.google.co.uk/groups?threadm=40E095F1.5CB35B41%40msn.com
>
> bill_morgan wrote:
> >
> > I installed a 3rd party Add_In through Tools/Add_Ins/Browse ... and then
> > clicked OK. The new Add_In name now appears in the Tools drop down menu.
> >
> > So far so good.
> >
> > Then I created my own Add_In (.xla file). I followed the same procedure as
> > above, but my own Add_In does not appear in the Tools drop down menu even
> > though its box is checked in the Add_Ins Available dialog box.
> >
> > What further steps do I need to take to get my new Add_In to appear in the
> > Tools drop down list?
> >
> > Thanks for your help ...
>
> --
>
> Dave Peterson
>
.