+ Reply to Thread
Results 1 to 7 of 7

add a reference to Microsoft Visual Basic for Applications Extensibility" at run time

  1. #1
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    add a reference to Microsoft Visual Basic for Applications Extensibility" at run time

    Hi
    I've been on the WEB most of the day trying to figure this out. Is there code to "add a reference to Microsoft Visual Basic for Applications Extensibility" at run time.
    I have this code that seems to require such a reference
    Please Login or Register  to view this content.
    And it results in this (after I set the reference manually)
    Please Login or Register  to view this content.
    Can I set the Reference pragmatically?
    As always, your help is deeply appreciated.
    John
    Last edited by jaslake; 08-18-2010 at 03:23 PM.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: add a reference to Microsoft Visual Basic for Applications Extensibility" at run

    If you add the reference manually (Tools -> References) when the file is distributed then assuming the same library is available on the other clients the library will be available.

    You can add references via the Workbook Open event but unless there are version specific issues with the library itself it's often not necessary.

  3. #3
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,976

    Re: add a reference to Microsoft Visual Basic for Applications Extensibility" at run

    You could also just late bind and not worry about the reference.
    Everyone who confuses correlation and causation ends up dead.

  4. #4
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: add a reference to Microsoft Visual Basic for Applications Extensibility" at run

    Hi DonkeyOte

    This is REALLY what I am asking
    You can add references via the Workbook Open event
    I was all over the Internet for hours looking for code to do just that. Alas, to know avail. Any idea what the code is to do that?

    Hi romperstomper

    I solved the issue by
    just late bind and not worry about the reference
    Thanks to both of you. I'll leave this as unsolved for a few days to see if I get feedback on the code question.

    John

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: add a reference to Microsoft Visual Basic for Applications Extensibility" at run

    You can develop early-bound, test both early- and late-bound, and then leave it whichever way you like. For example,

    Please Login or Register  to view this content.
    That way you get IntelliSense during development.
    Entia non sunt multiplicanda sine necessitate

  6. #6
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,976

    Re: add a reference to Microsoft Visual Basic for Applications Extensibility" at run

    Programmatically it would be:
    Please Login or Register  to view this content.
    for example.

  7. #7
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: add a reference to Microsoft Visual Basic for Applications Extensibility" at run

    Hi romperstomper

    After your last post, I searched on
    VBProject.References.AddFromGuid
    and found a wealth of information. Just didn't know what to search for. Thanks for that!

    John

+ 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