+ Reply to Thread
Results 1 to 3 of 3

permanently add reference to ADO library

  1. #1
    Loane Sharp
    Guest

    permanently add reference to ADO library

    Hi there
    I find it a bit irritating that, every time I create a new procedure in a
    new workbook, I need to add a reference to the ADO object library. Is there
    any way that I can have this reference added permanently?
    Best regards
    Loane



  2. #2
    DM Unseen
    Guest

    Re: permanently add reference to ADO library

    This is not possible, because references are handled per workbook.

    I would suggest the following workaround:
    Create a new workbook, add all your references, and save as a template
    to your template folder. Now create a new workbook based on your new
    template

    Dm Unseen


  3. #3
    keepITcool
    Guest

    Re: permanently add reference to ADO library


    Create an addin that does it for you...
    following will setup an application event monitor
    and add the reference when a NewWorkbook event is detected.


    '<<code for THISWORKBOOK module>>
    Option Explicit

    Dim WithEvents xlApp As Application

    Private Sub Workbook_Open()
    Set xlApp = Application
    End Sub

    Private Sub xlApp_NewWorkbook(ByVal wb As Workbook)
    Call AddAdoReference(wb)
    End Sub

    Sub AddAdoReference(ByVal wb As Workbook)
    wb.VBProject.References.AddFromFile _
    "C:\Program Files\Common Files\System\ado\msado15.dll"
    End Sub



    --
    keepITcool
    | www.XLsupport.com | keepITcool chello nl | amsterdam


    Loane Sharp wrote :

    > Hi there
    > I find it a bit irritating that, every time I create a new procedure
    > in a new workbook, I need to add a reference to the ADO object
    > library. Is there any way that I can have this reference added
    > permanently? Best regards Loane


+ 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