+ Reply to Thread
Results 1 to 10 of 10

VBA Tools Reference-Check if enabled + enable if not?

  1. #1
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    VBA Tools Reference-Check if enabled + enable if not?

    Would it be possible to determine whether a specific VBA Tools Reference is enabled? (if possible without checking the registry)

    If yes - would it be possible to enable that reference without user input required?

    If no to the last question - would it be possible to prompt the user to enable the reference required?
    *******************************************************

    HELP WANTED! (Links to Forum threads)
    Trying to create reusable code for Custom Events at Workbook (not Application) level

    *******************************************************

  2. #2
    Valued Forum Contributor
    Join Date
    08-13-2012
    Location
    Gardony, Hungary
    MS-Off Ver
    Excel 2003
    Posts
    558

    Re: VBA Tools Reference-Check if enabled + enable if not?

    Hey,

    I did some searching and it seems that you either need the place of the reference file or the GUID. Here are two useful links:
    http://www.vbaexpress.com/kb/getarticle.php?kb_id=267
    http://www.wiseowl.co.uk/blog/s204/vbe-references.htm

  3. #3
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: VBA Tools Reference-Check if enabled + enable if not?

    Hi, mc84excel,

    you´re not too specific about what you are asking...

    Yes, can be (like said) but only of all references are working properly (no broken links). And the adding relates to which references you are looking for: a workbook distributed and fitted with the links should work correctly if the given or higher instance of reference is available.

    Please Login or Register  to view this content.
    Sample is for MS Visual Basic for Applications Extensiblity 5.3.

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

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

    Re: VBA Tools Reference-Check if enabled + enable if not?

    It also assumes your user has trusted access to the VBProject. It is almost always a simpler and better solution to late bind your code.
    Remember what the dormouse said
    Feed your head

  5. #5
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: VBA Tools Reference-Check if enabled + enable if not?

    Quote Originally Posted by HaHoBe View Post
    Sample is for MS Visual Basic for Applications Extensiblity 5.3.
    Excellent. That happened to be the very library I wanted to enable programmatically.

    Quote Originally Posted by HaHoBe View Post
    you´re not too specific about what you are asking...
    That was deliberate.

  6. #6
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: VBA Tools Reference-Check if enabled + enable if not?

    Quote Originally Posted by romperstomper View Post
    It also assumes your user has trusted access to the VBProject.
    True. Point taken.

    I found this covered in detail on Chip Pearsons website: http://www.cpearson.com/excel/vbe.aspx (It had the enable Extensibility reference on there too. Oh well).

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

    Re: VBA Tools Reference-Check if enabled + enable if not?

    I have to say I can't see the need for this. I've never heard of the VBA Ext reference being broken or missing anyway, and late binding would be simpler.

  8. #8
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: VBA Tools Reference-Check if enabled + enable if not?

    Quote Originally Posted by romperstomper View Post
    I have to say I can't see the need for this. I've never heard of the VBA Ext reference being broken or missing anyway
    I work on one computer where it is impossible to access VBA Tools References (just gets this message 'Error accessing the system registry'). So I like the ability to enable a reference library programmatically.

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

    Re: VBA Tools Reference-Check if enabled + enable if not?

    Out of curiosity, does it work on that computer? I'd be more interested in fixing the issue but that's me (you still don't actually need the reference)

  10. #10
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: VBA Tools Reference-Check if enabled + enable if not?

    Quote Originally Posted by romperstomper View Post
    Out of curiosity, does it work on that computer? I'd be more interested in fixing the issue but that's me (you still don't actually need the reference)
    Yes the code worked fine. I find it handy to add a call to this sub at the start of code that requires use of that reference. (btw the computer has now been fixed )

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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