Results 1 to 6 of 6
  1. #1
    3 Star Lounger
    Join Date
    Apr 2002
    Location
    Texas, USA
    Posts
    208
    Thanks
    0
    Thanked 1 Time in 1 Post

    Hooking into an AddIn (2000/XP)

    I use a program that uses Excel for financial reporting. MY product uses an Ecel Add-In to do a majority of the processing. What I'd like to do is have my own Add-In hook into this Add-In so that mine could perform certain functions based on when the original Add-In does something. Is this possible and if so how?

    Thanks in advance.
    Ed

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Hooking into an AddIn (2000/XP)

    We need more details to be able to answer your question.

    Is it a custom/protected addin? Can you work with its code directly? can you work with it indirectly (call procedures etc)?

    Your addin could do certain tasks, call the other addin code (which would do its tasks) and then do you could do other things. The kicker is "can you call individual modules/routines" in the other addin from your code (do you know the names of the routines, can you call them from menu commands, can you use the macro recorder to record certain tasks, etc)?

    Steve

  3. #3
    3 Star Lounger
    Join Date
    Apr 2002
    Location
    Texas, USA
    Posts
    208
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Hooking into an AddIn (2000/XP)

    The Add-in is not protected. I can work with the code directly however I'm trying to avoid altering it as much ass possible to avoid problems with updates to the Add-in. The reason for what I am trying to do is that I do not believe the company that makes this Add-In will incorporate my added functionality into there product however i want to use that functionality for my own reports. If I can create an Add-in of my own that hooks into this Add-in then I can place all of my additional functionality into my own Add-in and not worry about having to add code again when the company sends out a new version of their Add-In.

    I hope that's enough info.

    Thanks!

  4. #4
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Hooking into an AddIn (2000/XP)

    You should be able to write code which calls the other addins procedures directly. If I understand you correctly:

    Imagine you they have a procedure in the other addin called Dick that you run from a button or menu, that you want to customize. Before "Dick" runs you want to do a procedure you call "Tom" and after "Dick" is run you want to do a procedure you call "Harry".

    Create Dick and harry subs. Create a sub similar to:

    <pre>Sub NewDick()
    Tom
    Dick
    Harry
    End Sub
    </pre>


    Steve

  5. #5
    3 Star Lounger
    Join Date
    Apr 2002
    Location
    Texas, USA
    Posts
    208
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Hooking into an AddIn (2000/XP)

    Great tip! The problem though is that the other Add-In is going to run regardless of what I do so I do not want to call the individual subs and functions from my Add-In and then have that Add-In run those same procedures again. Ideally I'd like to hook into the Add-In so that when a procedure is executed my Add-In could intercept the call, do anything it needs to do and then return control back to the other Add-In's code. I believe this would be similiar to sub-classing in VB.

    Thanks again!
    Ed

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

    Re: Hooking into an AddIn (2000/XP)

    Unless the add-in makes changes you can trap using workbook/worksheet events (reproducibly...) I strongly doubt if you can fire code from things other code does.
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

Posting Permissions

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