Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Removing unused reference | Excel Programming | |||
Global array data got erased after removing reference in VBA | Excel Programming | |||
Removing reference generates type mismatch error | Excel Programming | |||
Removing $$ Reference in cells | Excel Worksheet Functions | |||
Removing a reference | Excel Programming |