Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Feb 2001
    Thanked 0 Times in 0 Posts

    Adding and Severing References on open and close ((Excel 2k sr1))


    I am currently developing an Add-In that is designed to work only when a specific workbook is opened. I have been able to succesfuly create the reference to the add-in at design time. However, when I close the workbook that uses the procedures in the add-in, the toolbar and menu remain behind.

    How can I hide any trace of the add-in so that the users will not try to use it with other workbooks?

    Basicaly, I want the add-in to appear when the target workbook is opened and disappear when the target is closed or deselected.


  2. #2
    Gold Lounger
    Join Date
    Feb 2001
    Dublin, Ireland, Republic of
    Thanked 0 Times in 0 Posts

    Re: Adding and Severing References on open and close ((Excel 2k sr1))

    You could use the workbook close event to set the installed proprty to false. Place the following code in the ThisWorkbook object of the Workbook that uses the AddIn:<pre>Private Sub Workbook_BeforeClose(Cancel As Boolean)
    AddIns("AddinName").Installed = False
    End Sub</pre>

    replacing "AddinName" with the actual name of your Addin.

    Just as a matter of interest, if the AddIn is for the use of a single workbook, why not build the functionality into the workbook itself ?.

    Andrew C

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts