View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Ken Laws [MSFT] Ken Laws [MSFT] is offline
external usenet poster
 
Posts: 2
Default Custom menus clean-up


Hi Peter,

As I understand your question, you have written a COM Add-in for Microsoft
Excel. The add-in creates a custom menu in Microsoft Excel and you would
like to find a method to remove the custom menu when the user exits
Microsoft Excel to prevent it from being saved within the Excel.xlb file.

You have tried various application events within Microsoft Excel but
haven't found an event that would provide an optimal solution.

Have you tried adding the code to remove the custom menu to either the
OnDisconnection or OnBeginShutdown events of the COM Add-in?

If not, I would suggest using one of these events as they should only be
executed when the COM Add-in is being unloaded or when the Excel
Application begins to shut down which I believe would provide a cleaner
solution to 1) prevent the custom menu from being added to the XLB file and
2) to insure that the menu is unloaded when the user is exiting Microsoft
Excel.

I hope this helps!

If you have any questions please let me know via the posting.

Regards,

Ken Laws
Microsoft Support


This posting is provided "AS IS" with no warranties, and confers no rights.