Phil Hibbs presented the following explanation :
If I start Excel up from the Start Menu, everything is fine. My add-
ins work with no complaints. If I start Excel by opening a
spreadsheet, though, the add-ins don't load until I invoke their menu
item, and then I get a macro security message box. Am I doing
something wrong, or is this normal behaviour?
Phil Hibbs.
Sounds to me like your addin is using an 'attached' custom
menus/toolbar that you built via the Excel the UI, and if so then ditch
it and go with the suggestions that follow.
If your addin may also be creating 'Permanent' menus that persist in
the UI, whether the addin is loaded or not. The fact that it doesn't
load until you click one of its menus suggests the addin has not been
properly 'installed' via Addins Manager. Is it really an addin (.xla)
or just a workbook (.xls) with macros?
If Addin creating its own menus:
First thing I suggest is to set the IsTemporary property to TRUE, and
add code to delete the menus on shutdown. Compliment that by ensuring
your addin creates new menus on startup only AFTER it deletes them in
that same procedure. This will prevent duplication if the menus already
exist in cases, for example, restart after Excel crashes (if
AutoRecovery is enabled).
It's good programming practice to ensure that whatever changes to Excel
are made by your project (at startup or during runtime) that these get
undone at shutdown.
HTH
Garry