Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I think my Idea of a reference is wrong?
Is that a question? Difficult to understand what you are doing and why you want to change file location of the dll. However if that's what you are doing, and the dll is an ActiveX, you will need to re-register the dll. Having done that, providing the dll is the same version or later as that to which a reference was set in your project, you shouldn't need to remove and re-add the reference to your project. Regards, Peter T "vqthomf" wrote in message ... I think my Idea of a reference is wrong? I am trying to change the location of this file Y:\Quality\GALC system\HTR support\Turkey\Data Files\msadox.dll to another location can this be done as nothing I have tried works. TIA Charles "Peter T" wrote: Hi Charles, Without seeing your code its not possible to know if it fails because the code is wrong or fails for some other reason, eg the reference doesn't exist. Try something like this - Dim rf As Reference 'With ThisWorkbook.VBProject.References With Application.VBE.ActiveVBProject.References On Error Resume Next Set rf = .Item("ref name to be removed") If Not rf Is Nothing Then .Remove rf Else ' ref doesn't exist End If End With Regards, Peter T "vqthomf" wrote in message ... Hi all I was wondering if Reference location be changed using vba code I have tried using Application.VBE.ActiveVBProject.References.AddFrom File but I need to remove the reference before adding a new one when I try to remove the it I get an error has one done this before if so can you please help?. TIA Charles |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Cannot change Chart location? | Charts and Charting in Excel | |||
Can I Change the Location of the Tabs? | Excel Discussion (Misc queries) | |||
Registry Location for References in VBe | Excel Programming | |||
How are actual file location of VBA References treated? | Excel Programming | |||
Copy/Paste without changing location references | Excel Discussion (Misc queries) |