Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Nov 2002
    Posts
    387
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Excel Add-ins and COM Add-ins (Excel 2002/1)

    I have asked about this before but wanted to again and describe it in a different way plus ask some other questions.
    First about Excel Add-ins( xla ) in general. I have notice that a xla that I created for use with one Excel file is being loaded for all Excel files I open, is this normal behavior and is there a way to select if a xla addin will be loaded via vba?

    second: I have noticed the same behavior for COM add-ins, that an add-in created for a particular Excel file or files is being loaded for any Excel file, even a blank one. Is there a way to not have the Com add-in loaded upon startup and select when to load it and unload it?

    third. This is the repeat question. We have nearly 200 excel templates and everyone of the template's "ThisWorkbook" object has the same events and code to handle the events in them. We what to blank out the events and code in those templates "ThisWorkbook" object and replace the handling of those events with a COM add-in. I have tried various coding in an attempt to hook the events that occur with a "ThisWorkbook" object to code in a COm add-in but the code for the events are never handled( seen) by the code in the COM add-in. Does anyone have an idea on how to do this?

    Thanks

    Jim

  2. #2
    5 Star Lounger
    Join Date
    Feb 2001
    Location
    Dallas plus 20 miles or so, Texas, USA
    Posts
    876
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Excel Add-ins and COM Add-ins (Excel 2002/1)

    Hi Jim,

    In 2000 you can control the installed state of add-ins with something such as the following:

    AddIns("Analysis ToolPak").Installed = True

    It is normal for the addins which are installed to load with every workbook unless you use something similar to the above to change the installed state. Not sure if any of this applies with XP. Not much I can say about the third part of your question.

  3. #3
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Excel Add-ins and COM Add-ins (Excel 2002/1)

    You can create an application level event handler that responds to the opening of any workbook.
    See this page for an extensive explanation.
    Of course your code would need to determine what to do based on what workbook has been opened.
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  4. #4
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Excel Add-ins and COM Add-ins (Excel 2002/1)

    Hi Jim,
    To take your questions in order:
    1. Yes that's normal behaviour for an Excel add-in. Yes, you can control the loading of the add-in through VBA, but then you have to decide where to put that VBA code....
    2. The default behaviour for a COM add-in is load on startup. You can change this to load on demand.
    3. I think Jan Karel has pointed you in the right direction on this but if you do need more help, post back with a bit more detail and we'll try and help.
    Regards,
    Rory

    Microsoft MVP - Excel

Posting Permissions

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