Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8616241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T05:34:16+00:00 2026-06-12T05:34:16+00:00

I want to add a vba function to personal.xlsb, but this function has an

  • 0

I want to add a vba function to personal.xlsb, but this function has an ADODB.Connection object in it.

I can resolve that by (in the VBA editor) selecting tools -> references and then checking the box “Microsoft ActiveX Data Objects 6.0 Library”

My question is, how do I make “Microsoft ActiveX Data Objects 6.0 Library” one of my default references so that it is always available whenever I start up excel?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T05:34:17+00:00Added an answer on June 12, 2026 at 5:34 am

    While Siddharth’s solution is very handy, I thought I would offer these functions from a tool I rolled out where we were constantly getting calls that related to the fact the user didn’t have the proper references checked in the VBE in their Excel version, for many possible reasons.

    Just throwing it out as an option and something to look it. There are some very project specific features in it, but you could modify it to work with your needs probably pretty easily.

    Function ValidateReferences() As Boolean
    'makes sure that user has the proper references installed for downloading data through API
    
    Dim arrDescription() As String, arrGUID() As String
    Dim arrMajor() As Long, arrMinor() As Long
    Dim strMessage As String
    
    
    ValidateReferences = True
    
    'removes any broken references
    For i = ThisWorkbook.VBProject.References.Count To 1 Step -1
        If ThisWorkbook.VBProject.References.Item(i).IsBroken Then ThisWorkbook.VBProject.References.Remove ThisWorkbook.VBProject.References.Item(i)
    Next
    
    'will attempt to add the reference for the user
    arrGUID() = Split("{2A75196C-D9EB-4129-B803-931327F72D5C},{E6C9285A-7A87-407A-85E7-D77A70C100F5},{45A929B3-E493-4173-B6E5-0CD42041C6DC},{F24B7FA2-8FB9-48B7-825F-7C9F4A82F917},{7A80DAB5-1F61-4F9A-A596-561212ACD705},{18142BD6-1DE1-412B-991C-31C7449389E6},{C3ED6DC2-BED0-4599-A170-B1E1E32C627A}", ",", , vbTextCompare) ' {2A75196C-D9EB-4129-B803-931327F72D5C}
    arrDescription() = Split("Microsoft ActiveX Data Objects 2.8 Library,myDummyRef COM 3.8.0,myDummyRef COM 3.8.0,myDummyRef COM 3.8.0,myDummyRef 3.6.0 Library,myDummyRef,myDummyRef Library", ",", , vbTextCompare) 'Microsoft ActiveX Data Objects 2.8 Library
    ReDim arrMajor(6)
        arrMajor(0) = 0 '0
        arrMajor(1) = 3 '3
        arrMajor(2) = 3 '3
        arrMajor(3) = 3 '3
        arrMajor(4) = 3 '3
        arrMajor(5) = 1 '1
        arrMajor(6) = 1 '1 -> ADODB = 2
    ReDim arrMinor(6)
        arrMinor(0) = 0
        arrMinor(1) = 8
        arrMinor(2) = 8
        arrMinor(3) = 8
        arrMinor(4) = 6
        arrMinor(5) = 0
        arrMinor(6) = 0 '-> ADODB = 8
    
    For i = LBound(arrGUID()) To UBound(arrGUID())
        On Error GoTo ErrCheck
        If i = 0 Then 'adodb not working on AddFromFile. I could use add from file on all references, perhaps? -> refactor later
            ThisWorkbook.VBProject.References.AddFromFile ("C:\Program Files\Common Files\System\ado\msado15.dll")
        Else
            ThisWorkbook.VBProject.References.AddFromGuid arrGUID(i), arrMajor(i), arrMinor(i)
        End If
    Next
    
    If ValidateReferences = False Then MsgBox "The following references could not be added to the VB Project: " & Right(strMessage, Len(strMessage) - 2) & "." & vbNewLine & vbNewLine & "Please refer to 4. Appropriate DLL Files on the 'Connectivity_Help' tab for more information."
    
    Exit Function
    
    ErrCheck:
        Select Case Err.Number
            Case Is = 32813 'reference already in use, nothing to report
            Case Else
                ValidateReferences = False
                strMessage = strMessage & ", " & arrDescription(i)
        End Select
        Resume Next
    
    End Function
    

    This function will print your reference information to help you find the dll for it, but the reference has to be checked for it to print it.

    Sub print_ref_path()
    
    Dim i As Integer
    
    For i = ThisWorkbook.VBProject.References.Count To 1 Step -1
        Dim strName As String, strPath As String, strGUID as String
        strName = ThisWorkbook.VBProject.References.Item(i).name
        Debug.Print strName
        strPath = ThisWorkbook.VBProject.References.Item(i).FullPath
        Debug.Print strPath
        strGUID = ThisWorkbook.VBProject.References.Item(i).GUID 'think this is right, might need to change
    Next
    
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want add UIGestureRecognizerDelegate to UIWebView,but failed. if [self.view addsubView:webView]; So UIWebView is ok,but
I want add new Feed item on entity persist and update. I write this
I want add my custom sidebar next right column all page. Please check this
I have a list of string values that I want add to a hashtable
I want to add Gon ( https://github.com/gazay/gon ) to my activeadmin but I need
I have a VBA function IsValidEmail() that returns a boolean. I have a query
I want to add some VBA code when the value in a cell changes.
In my VBA code, I query a SQL table. I want to add an
This is a continuation of the question excel different SUM.IF array function , But
I need to write a script in VBA so that if column B has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.