Sure, in the same code that opens the workbook, open the addin as well.

As an alternative, you can load it as an addin, but opening it should have
the same effect.

--
Regards,
Tom Ogilvy


"ksr" wrote:

> Thanks.
> Is there any way I can have this macro execute when excel is started
> programatically?
>
>
> Tom Ogilvy wrote:
> > I see your deeply engaged with Don in some heavy duty topics, but just for
> > interest, Addins and files in the xlStart directory are not loaded when Excel
> > is started programmatically.
> >
> > --
> > Regards,
> > Tom Ogilvy
> >
> >
> >
> >
> >
> > "[email protected]" wrote:
> >
> > >
> > > Don Guillett wrote:
> > > > >>Application.EnableEvent(True)
> > > > Application.EnableEventS=true
> > > >
> > > >
> > > > Here is one I use with a double_click event to goto a workbook whose name is
> > > > typed in a cell.
> > > >
> > > > Sub GetWorkbook()
> > > > If ActiveCell.Value = "" Then Exit Sub
> > > > workbookname = ActiveCell.Value
> > > > On Error GoTo OpenWorkbook
> > > > Windows(workbookname & ".xls").Activate
> > > > Exit Sub
> > > > OpenWorkbook:
> > > > Workbooks.Open(workbookname & ".xls").RunAutoMacros xlAutoOpen
> > > > End Sub
> > > > --
> > > > Don Guillett
> > > > SalesAid Software
> > > > [email protected]
> > > > <[email protected]> wrote in message
> > > > news:[email protected]...
> > > > > Hello,
> > > > >
> > > > > I have an excel addin (.xla) file under excel startup folder (ie,
> > > > > \office11\startup), where I have defined App_WorkbookActivate event.
> > > > > This macro executes fine when I open the excel file from explorer. But
> > > > > when I open the file from automation, it does not execute.
> > > > > The code is as follows,
> > > > >
> > > > > Application.EnableEvent(True)
> > > > > ActiveWorkbook = AllWorkbooks.Open("filename")
> > > > > ActiveWorkbook.RunAutoMacros(3)
> > > > >
> > > > > Any suggestions would help!
> > > > >
> > > > > Thankyou.
> > > > >
> > >
> > > Thanks for your reply.
> > > The code looks similar, except for
> > > Windows(workbookname & ".xls").Activate
> > > What does the above line of code do?
> > > I am writing in c++ and I am not sure what is the code equivalent to
> > > the above in c++?
> > > I understand Workbook activate is executed when workopen is opened.
> > >
> > >

>
>