+ Reply to Thread
Results 1 to 10 of 10

Run Add-In code when Add-In is referenced

  1. #1
    Registered User
    Join Date
    11-30-2010
    Location
    X
    MS-Off Ver
    X
    Posts
    8

    Run Add-In code when Add-In is referenced

    Is there an event fired within an Add-In when it is referenced in VBE?

    I'm wanting to run some code as soon as the Add-In is referenced similar to on workbookopen.

    Thanks

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Run Add-In code when Add-In is referenced

    What kind of add-in and what exactly do you mean by referenced?
    Remember what the dormouse said
    Feed your head

  3. #3
    Registered User
    Join Date
    11-30-2010
    Location
    X
    MS-Off Ver
    X
    Posts
    8

    Re: Run Add-In code when Add-In is referenced

    A .xla add-in.

    Set a reference to the add-in in the VBE. Under references.

  4. #4
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Run Add-In code when Add-In is referenced

    If it's not already open, that would open it, but there is no specific event you can use for that. Why would you need it?

  5. #5
    Registered User
    Join Date
    11-30-2010
    Location
    X
    MS-Off Ver
    X
    Posts
    8

    Re: Run Add-In code when Add-In is referenced

    General set up. E.g. Programmatically adding other references I require to the active workbook etc.

    I was hoping there would be something similar to workbookopen but for the add-in.

  6. #6
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Run Add-In code when Add-In is referenced

    Is there a reason you can't have the references set in the addin?

  7. #7
    Registered User
    Join Date
    11-30-2010
    Location
    X
    MS-Off Ver
    X
    Posts
    8

    Re: Run Add-In code when Add-In is referenced

    The references need to be for the active workbook I am working on at the time.

    I feel that we are deviating from the question asked.

    I have a feeling the answer to my question is... No, there is no event fired and there is no clever little trick to fire code automatically when an add-in is opened??? :-( would you sat that is correct?

  8. #8
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Run Add-In code when Add-In is referenced

    There's no need for an addin to add references to your project.
    So there's no connection between having loaded an Addin and doing the things you gave as an example.
    But the vaguer your question the vaguer the answers. If you want specific answers please be specific in your question (which you were not in my opinion upto now).



  9. #9
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Run Add-In code when Add-In is referenced

    Quote Originally Posted by JamieMcLeod View Post
    The references need to be for the active workbook I am working on at the time.
    Then you will have to add them yourself - or if it's the same ones each time, add a routine to do it.
    I feel that we are deviating from the question asked.

    I have a feeling the answer to my question is... No, there is no event fired and there is no clever little trick to fire code automatically when an add-in is opened??? :-( would you sat that is correct?
    Yes - that's why we are deviating - trying to work out what it is you actually need and how to work around it, if possible. If you prefer a simple no, then ... no.

  10. #10
    Registered User
    Join Date
    11-30-2010
    Location
    X
    MS-Off Ver
    X
    Posts
    8

    Re: Run Add-In code when Add-In is referenced

    Haha a simple no will be fine.

    What I need to do is run code automatically when an add-in is referenced in the VBE. If that is not possible then what I want to do (in the bigger picture) cannot be achieved.

    I have the routine to add the references, this is what needs to be fired when the add-in is referenced itself.

    Thank you for you assistance though.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1