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: 25
Default Add Remove DLL reference in VB

Further to my previous post on the 10th, i have a few
questions/results to post,

i find it impossible to remove any reference without an
error coming up. I used the following code:

On Error Resume Next
Application.DisplayAlerts = False
With ThisWorkbook.VBProject.References
.Remove .Item("ProgressIndicator")
Debug.Print Err.Number
End With
Application.DisplayAlerts = True
On Error GoTo 0

Application.DisplayAlerts = False
ThisWorkbook.VBProject.References.AddFromFile
("c:\ProgressIndicator.dll")
Application.DisplayAlerts = True

So, in the first instance i delete the reference and then i
add it up again. Please note that in the current procedure
i do not use the dll, the dll is used from another procedure.

So, there are two cases one in which the dll is already
referenced and one in which it is not.

Suppose that it is referenced, then the code in deleteing
the reference comes up with "Can't enter break mode at this
time" and the options "continue" or "end only" are
possible. So i used debug.print err.number to get the error
number, which is zero!

If its not referenced then it goes smoothly through the
"deletion" routine (as there is nothing to delete) and
again comes up with "Can't enter break mode at this time"
"continue" or "end" options. Now, here the strangest thing
happens, i click on end and i have a look at the
references, and the code has added a reference to
"ProgressIndicator.dll" but not on "C:\" but rather on
"C:\windows\System32\". I really don't get and of course
the "ProgressIndicator.dll" does not reside on system32...

I am a bit perplexed, sorry for the big post,
Thanks a lot for your replies,
rgrds,
Alex



 
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
How to remove path from macro reference seppo Excel Discussion (Misc queries) 2 February 22nd 06 07:08 AM
remove rows with the same reference JT[_2_] Excel Programming 1 April 30th 04 03:48 PM
remove reference via code Brian Excel Programming 1 April 22nd 04 06:10 PM
Remove a reference Niklas[_3_] Excel Programming 8 November 11th 03 10:19 AM


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