Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 149
Default Remove a Reference

Code 1 adds the ADO 2.6 Library fine. Can someone tell me how code 2 should
read to remove the ADO 2.6 Library? I found CODE 2 as example on web, but
wasn't sure how it could be changed.

CODE 1
Application.VBE.ActiveVBProject.References.AddFrom File _
"C:\Program Files\Common Files\System\ado\msado26.tlb"

CODE 2
Set x = Application.VBE.ActiveVBProject _
.References.Item("Project2")

Application.VBE.ActiveVBProject.References.Remove x


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 811
Default Remove a Reference

"scott" wrote in message
...
Code 1 adds the ADO 2.6 Library fine. Can someone tell me how code 2
should read to remove the ADO 2.6 Library? I found CODE 2 as example on
web, but wasn't sure how it could be changed.
CODE 1
Application.VBE.ActiveVBProject.References.AddFrom File _
"C:\Program Files\Common Files\System\ado\msado26.tlb"
CODE 2
Set x = Application.VBE.ActiveVBProject _
.References.Item("Project2")
Application.VBE.ActiveVBProject.References.Remove x


Hi Scott,

Here's one way to do it:

Sub RemoveReference()
Dim x As Object
Set x = Application.VBE.ActiveVBProject _
.References.Item("ADODB")
Application.VBE.ActiveVBProject.References.Remove x
End Sub

--
Rob Bovey, Excel MVP
Application Professionals
http://www.appspro.com/

* Take your Excel development skills to the next level.
* Professional Excel Development
http://www.appspro.com/Books/Books.htm


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 do I remove a reference from a cell? stayathome working girl Excel Discussion (Misc queries) 1 April 18th 06 08:52 PM
Remove reference from code Dr.Schwartz Excel Programming 3 September 24th 04 01:15 PM
Remove reference names latha Excel Programming 4 August 3rd 04 01:13 AM
Add Remove DLL reference in VB Alex Excel Programming 8 June 14th 04 01:34 PM
Remove a reference Niklas[_3_] Excel Programming 8 November 11th 03 10:19 AM


All times are GMT +1. The time now is 05:21 PM.

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"