Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 493
Default Hard Code DLL Reference in VBA

Hi,

I 've created a DLL (from VB6) which is basically a progress bar. If i want to use it i have to go to Tools-- References to reference it.

The problem is that if you are spreading the application to a number of people you can't go around referencing the dll again and again..
I copied the file to our server and referenced it from there but for each new user i have to re-reference it again

Is there any way to 'hard code' the reference so that it works 'straight from the box'?

Any advice much appreciated,
Regards,
Alex
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 56
Default Hard Code DLL Reference in VBA

Hello Alex
Try
ThisWorkbook.VBProject.References.AddFromFile "Your Path\YourFile.dll"

HTH

Regards
Pascal

"alex" a écrit dans le message de
...
Hi,

I 've created a DLL (from VB6) which is basically a progress bar. If i

want to use it i have to go to Tools-- References to reference it.

The problem is that if you are spreading the application to a number of

people you can't go around referencing the dll again and again..
I copied the file to our server and referenced it from there but for each

new user i have to re-reference it again

Is there any way to 'hard code' the reference so that it works 'straight

from the box'?

Any advice much appreciated,
Regards,
Alex



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Hard Code DLL Reference in VBA

thanks a million for that it works just fine!

one more question once i add it then at the end of the
procedures i also want to delete it

i tried to use the following:
i=0
For Each v In ThisWorkbook.VBProject.References
If v.Name = "ProgressIndicator" Then 'Which occurs OK
ThisWorkbook.VBProject.References.Remove v "or"
v.remove
End If
Next

in both of the above cases it doesn't delete the reference
and it comes up with errors.

Now the basic problem is that you can not DIM something as
a Reference (hence i DIM'd v as Variant) and since the
..Remove property needs a reference in order to delete it
that creates a problem.

any ideas?

once more i appreciate your advice!
Alex
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default Hard Code DLL Reference in VBA

Hello Alex
Try
With ThisWorkbook.VBProject
.References.Remove .References("ProgressIndicator") ' or v.Name
End With

MP

"alex" a écrit dans le message de
...
thanks a million for that it works just fine!

one more question once i add it then at the end of the
procedures i also want to delete it

i tried to use the following:
i=0
For Each v In ThisWorkbook.VBProject.References
If v.Name = "ProgressIndicator" Then 'Which occurs OK
ThisWorkbook.VBProject.References.Remove v "or"
v.remove
End If
Next

in both of the above cases it doesn't delete the reference
and it comes up with errors.

Now the basic problem is that you can not DIM something as
a Reference (hence i DIM'd v as Variant) and since the
.Remove property needs a reference in order to delete it
that creates a problem.

any ideas?

once more i appreciate your advice!
Alex



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default Hard Code DLL Reference in VBA

Re Alex,
With ThisWorkbook.VBProject.References
.Remove .Item("ProgressIndicator")
End With
MP

"alex" a écrit dans le message de
...
thanks a million for that it works just fine!

one more question once i add it then at the end of the
procedures i also want to delete it

i tried to use the following:
i=0
For Each v In ThisWorkbook.VBProject.References
If v.Name = "ProgressIndicator" Then 'Which occurs OK
ThisWorkbook.VBProject.References.Remove v "or"
v.remove
End If
Next

in both of the above cases it doesn't delete the reference
and it comes up with errors.

Now the basic problem is that you can not DIM something as
a Reference (hence i DIM'd v as Variant) and since the
.Remove property needs a reference in order to delete it
that creates a problem.

any ideas?

once more i appreciate your advice!
Alex



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
Hard code month in Excel Rachel Costanza Excel Discussion (Misc queries) 6 November 7th 08 02:04 AM
Hard reference in a macro Richard Champlin Excel Discussion (Misc queries) 1 August 24th 07 10:24 PM
Not Hard Code If FIRSTROUNDKO via OfficeKB.com Excel Discussion (Misc queries) 3 July 10th 07 04:11 PM
Hard-code source data Melanie Martin Charts and Charting in Excel 5 December 29th 05 02:07 PM
Hard Code DLL Reference in VBA alex Excel Programming 0 June 10th 04 01:20 PM


All times are GMT +1. The time now is 01:09 PM.

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"