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

    How does one load/unload a COM AddIn via code (Excel 2000/Excel 2002)

    How does one load and unload an Excel COM AddIn via code such as VBA, as we do not wish to have the COM addin loading on startup of every Excel application?

  2. #2
    Bronze Lounger
    Join Date
    Jun 2001
    Location
    New York, New York, Lebanon
    Posts
    1,449
    Thanks
    1
    Thanked 1 Time in 1 Post

    Re: How does one load/unload a COM AddIn via code (Excel 2000/Excel 2002)

    <img src=/S/hello.gif border=0 alt=hello width=25 height=29> Jim

    Wow this question has gone on for so long unanswered, that means people here did not see it, or don't know the real answer YET!!!

    But I found this MSDN article for you, check it out and let me know if it helps.

    Check the section on Choosing Development Tools where it says:

    <<< ... The designer has a graphical user interface component that allows you to quickly specify basic characteristics, such as the add-in's load behavior and target application. >>>

    The Load behavior settings include Load on Demand and Load at Next Startup Only, so maybe this is the area you want to look into.

    HTH

    Wassim
    <img src=/S/compute.gif border=0 alt=compute width=40 height=20> in the <img src=/S/bagged.gif border=0 alt=bagged width=22 height=22>

  3. #3
    2 Star Lounger
    Join Date
    Dec 2000
    Posts
    140
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How does one load/unload a COM AddIn via code (Excel 2000/Excel 2002)


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

    Re: How does one load/unload a COM AddIn via code (Excel 2000/Excel 2002)

    Thanks! Yea I know about the MSN article and the Designer interface where you select how the COM Addin is loaded but that is as far as the dicussion goes as there is no example of how to load in on demand other than via a toolbar or menu item. Even then responding to the toolbar or menu load event there is no explanation of how the COM Addin is loaded via code. The reason we want to load on demand is becuase if a COM AddIn is set to load on startup then that COM AddIn is loaded for every Excel started application, even for applications where one would not desire that COM AddIn to be loaded.

  5. #5
    3 Star Lounger Jim Cone's Avatar
    Join Date
    Feb 2002
    Location
    Portland, Oregon, USA
    Posts
    238
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: How does one load/unload a COM AddIn via code (Excel 2000/Excel 2002)

    Jim,

    ...
    HOWTO: Install an Excel Add-In (XLA or XLL) with Automation
    The information in this article applies to:
    Microsoft Excel 2000
    Microsoft Excel 97 for Windows
    Microsoft Visual Basic Professional Edition for Windows 6.0
    Microsoft Visual Basic Enterprise Edition for Windows 6.0
    Microsoft Excel 2002...

    http://"]http://support.microsoft.com/?kbid=280290">http:// http://support.microsoft.com/?kbid=280290[/url]

    Regards,

    Jim Cone
    San Francisco, CA

  6. #6
    3 Star Lounger
    Join Date
    Nov 2002
    Posts
    387
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: How does one load/unload a COM AddIn via code (Excel 2000/Excel 2002)

    Thanks. What the article refers to are xla and xll type addins but what I am asking about is loading a COM AddIn via code.

  7. #7
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: How does one load/unload a COM AddIn via code (Excel 2000/Excel 2002)

    The URL for Q280290, Install an Excel Add-In (XLA or XLL) with Automation, referenced above should be http://support.microsoft.com/default.aspx?...kb;en-us;280290. It's excellent, thanks Wassim and Jim Cone!
    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

  8. #8
    Silver Lounger
    Join Date
    Mar 2001
    Location
    Springfield, Ohio, USA
    Posts
    2,136
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: How does one load/unload a COM AddIn via code (Excel 2000/Excel 2002)

    The code would be
    <pre>Application.COMAddIns("ccc.ddd").Connect = True</pre>

    where ccc is the name of your addin, ie ccc.dll
    and ddd is the name of your Designer
    <font face="Comic Sans MS">Sam Barrett, CACI </font face=comic>
    <small>And the things that you have heard... commit these to faithful men who will be able to teach others also. 2 Timothy 2:2</small>

Posting Permissions

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