Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can dll be placed on Network drive

Status
Not open for further replies.

C2345

Programmer
Feb 15, 2002
18
US
I have created a dll which can be called from a custom Excel workbook. The workbook can successfully use the dll when it is installed on a user's machine.

I would like to be able to keep the dll on a network drive that the users could access but keep the custom workbook on the user's machine. The purpose of this would be to allow me to update the dll without having to redistribute it to each individual user's machine. Is this possible and if so is there any description of the process?
 
Possible, maybe. You'd still have to register the DLL at the remote location. I'm not sure this is legal but perhaps Windows doesn't care.

Practical? Maybe not. Loading may be slow and if there is no network connection or the server or share is down users would get errors.
 
This might not be the appropriate place to ask but I have exhausted other areas and you would know the answer given your message above. How do I use a self-created DLL file in Excel? When I register it I am told that it cannot find the entry point. When I try to import it into Tools - Addins - Automation in excel I am told that the file does not contain a new automation server or I don't have the privileges to create one. Is this latter message due to my registration problems. Here is my test code, borrowed from another help area. I would really appreciate a solution to this urgent problem. Thank you.


ption Explicit On
Public Class Class1


Public Const DLL_PROCESS_DETACH = 0
Public Const DLL_PROCESS_ATTACH = 1
Public Const DLL_THREAD_ATTACH = 2
Public Const DLL_THREAD_DETACH = 3

Public Function DllMain(ByVal hInst As Long, ByVal fdwReason As Long, ByVal lpvReserved As Long) As Boolean
Select Case fdwReason
Case DLL_PROCESS_DETACH
' No per-process cleanup needed
Case DLL_PROCESS_ATTACH
DllMain = True
Case DLL_THREAD_ATTACH
' No per-thread initialization needed
Case DLL_THREAD_DETACH
' No per-thread cleanup needed
End Select
End Function

Public Function Increment(ByVal var As Integer) As Integer
If Not IsNumeric(var) Then Err.Raise(5)

Increment = var + 1
End Function

Public Function Decrement(ByVal var As Integer) As Integer
If Not IsNumeric(var) Then Err.Raise(5)

Decrement = var - 1
End Function

Public Function Square(ByVal var As Long) As Long
If Not IsNumeric(var) Then Err.Raise(5)

Square = var ^ 2
End Function
Public Function Times2(ByVal a As Integer) As Integer
Times2 = a * 2
End Function

End Class





 
To respond to the OP's question, yes you can. This is what DCOM (distributed COM) is all about. Another means of accomplishing this is through MTS or the newer COM+.

You might want to read up on all those acronyms a bit and see if your question gets answered for you.

Popper, it would be better if you created this in a separate thread. However, it sounds like you may not have created this as a DLL in VB, because the system is saying that it doesn't find the entry point interfaces that it needs to use the code and so refuses to register it. I'm going to ask you to put any response to this as a new thread, so that we can address the original poster's questions on this one and not confuse people who at some point in the future are looking for help on one topic or the other.

Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top