Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 989
Default VBA reference via code

Hi,
Is it possible to add a VBA reference via VBA code.
For example I will need to check when the spreadsheet open if ADO reference
is setup, and if not set up to set it up.
Thanks.
Mark
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default VBA reference via code

Mark,

Try something like

On Error Resume Next
ThisWorkbook.VBProject.References.AddFromGuid _
GUID:="{B691E011-1797-432E-907A-4D8C69339129}", major:=0, minor:=0

See also www.cpearson.com/excel/vbe.htm


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting LLC
www.cpearson.com
(email on the web site)



"mark" wrote in message
...
Hi,
Is it possible to add a VBA reference via VBA code.
For example I will need to check when the spreadsheet open if ADO
reference
is setup, and if not set up to set it up.
Thanks.
Mark


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
Select reference via code Harley Excel Programming 2 March 6th 07 12:30 AM
Reference to Add-In for VBA code? Don Wiss Excel Programming 3 February 14th 07 09:15 AM
VBA code to set a reference Trefor Excel Programming 9 November 16th 05 08:57 AM
How to make a button VBA code reference other VBA code subroutines??? gunman[_9_] Excel Programming 4 September 27th 05 01:01 AM
Hard Code DLL Reference in VBA alex Excel Programming 4 June 10th 04 05:05 PM


All times are GMT +1. The time now is 09:42 AM.

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

About Us

"It's about Microsoft Excel"