I want to create a DLL using C#, which can be then called from VBA in the following manner –
Private Declare Function invokePath Lib "\\shared_computer\Projects\somedll\myDLL.dll" (ByVal strUName As String, ByVal strSFile As String) As String
The idea is, if the path of the DLL is changed I need to only update the path in the Private Declare function line….
I have searched a lot for it, and also not sure whether this arrangement is possible – where we can call a DLL function from a network path without referencing or registering.
You can not create unmanaged DLLs with C#, as C# is a .NET only language. Use C++.
The only way to use a .NET DLL from unmanaged code (for example VBA) is to use COM interop.