Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 233
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default 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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to check Solver and Forms 2.0 Object Library permanently? yoyo2000 Excel Discussion (Misc queries) 1 September 26th 05 03:04 AM
VBA Reference Library ADO 2.7 Glazunov Excel Programming 0 May 23rd 05 06:36 PM
Add-ins and Reference library Glen Mettler[_4_] Excel Programming 1 December 5th 04 11:41 AM
Reference Library - Missing Library in a lower version. luvgreen Excel Programming 1 October 7th 04 02:08 AM
Reference Library Kevin Wickersheim Excel Programming 2 May 5th 04 08:18 PM


All times are GMT +1. The time now is 04:58 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"