Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Removing a reference from the LIST

Hello all,

I have tried to google search but I got only links explaining how to
remove a reference from a VBA project.

At the moment I am developping a C# addin, however each time I
reference it, it creates a new entry in the references list. Is it
programmatically possible in VBA or C# to check all the reference and
remove the bogus ones from the list itself ?

Cheers
Anthony

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 178
Default Removing a reference from the LIST

In VBA, before referencing your add-in, delete the old reference using
something like....

Dim iIndex As Integer
Dim strMyReference As String
Dim refReference As Variant

'full path and name of C # addin
strMyReference = "C:\Client\addins\My_C_Addin.dll"

iIndex = 0
For Each refReference In _
Application.VBE.ActiveVBProject.References
iIndex = iIndex + 1
If refReference.FullPath = strMyReference Then
'remove reference
With Application.VBE.ActiveVBProject.References
.Remove .Item(iIndex)
End With
Exit For
End If
Next

--
HTH,
Gary Brown

If this post was helpful to you, please select ''YES'' at the bottom of the
post.



"BlueTrin" wrote:

Hello all,

I have tried to google search but I got only links explaining how to
remove a reference from a VBA project.

At the moment I am developping a C# addin, however each time I
reference it, it creates a new entry in the references list. Is it
programmatically possible in VBA or C# to check all the reference and
remove the bogus ones from the list itself ?

Cheers
Anthony


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
Removing unused reference KarenH Excel Programming 6 April 6th 06 05:11 PM
Global array data got erased after removing reference in VBA Santh Excel Programming 1 February 7th 06 12:56 PM
Removing reference generates type mismatch error quartz[_2_] Excel Programming 4 December 14th 05 03:50 PM
Removing $$ Reference in cells Castor Excel Worksheet Functions 1 August 13th 05 12:36 AM
Removing a reference Andrew B[_3_] Excel Programming 1 July 22nd 04 01:32 PM


All times are GMT +1. The time now is 04:51 AM.

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"