LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Change Location of VBE References with VBA

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
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
Cannot change Chart location? Canlink Charts and Charting in Excel 1 June 2nd 08 04:26 PM
Can I Change the Location of the Tabs? Pam Excel Discussion (Misc queries) 2 December 22nd 06 01:09 PM
Registry Location for References in VBe Mike McNeill Excel Programming 4 December 22nd 06 11:40 AM
How are actual file location of VBA References treated? Nicholas Dreyer Excel Programming 0 October 22nd 06 08:16 AM
Copy/Paste without changing location references Tom Excel Discussion (Misc queries) 2 March 31st 05 01:31 PM


All times are GMT +1. The time now is 06:52 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"