View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Gary Brown[_5_] Gary Brown[_5_] is offline
external usenet poster
 
Posts: 236
Default Create/Remove Custom Menu Items from Add-in

Rob,
The reason I use Workbook_Open is because a wise man once said...
Newsgroups: microsoft.public.excel.programming
From: "Rob Bovey"
Local: Tues, Jan 15 2002 12:02 pm
Subject: Number of Auto_Open (Auto_Close) Events
"There's no problem with the concept, but Auto_Open and Auto_Close
procedures will not fire automatically in a workbook that's been
opened/closed from VBA."
That got me thinking so I changed to the 'Workbook_Open' and
Workbook_BeforeClose' procedures.
Question: Is there more of a chance that the ThisWorkbook object will
get corrupted than a module?
Question: Are you recommending the Auto_Open over Workbook_Open?
Thanks for your insights in advance. Always very interested in your
recommendations.
Sincerely,
Gary Brown


"Rob Bovey" wrote:

Hi Mike,

For the purposes of adding and removing custom menus for an add-in there
is no practical difference between the Auto_Open/Auto_Close procedures, the
Workbook_AddinInstall/Workbook_AddinUninstall events or the
Workbook_Open/Workbook_BeforeClose events. It's just a matter of preference.

I use Auto_Open/Auto_Close in all of my add-ins to avoid putting any
code behind the ThisWorkbook object. If that code ever becomes corrupted you
may have to rebuild the whole workbook, so I do my best to leave that module
empty.

--
Rob Bovey, Excel MVP
Application Professionals
http://www.appspro.com/

* Take your Excel development skills to the next level.
* Professional Excel Development
http://www.appspro.com/Books/Books.htm