Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Hard code month in Excel | Excel Discussion (Misc queries) | |||
Hard reference in a macro | Excel Discussion (Misc queries) | |||
Not Hard Code If | Excel Discussion (Misc queries) | |||
Hard-code source data | Charts and Charting in Excel | |||
Hard Code DLL Reference in VBA | Excel Programming |