Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 400
Default Using dll with a dynamic link in VB

What do you mean by 'address'? Do you mean location within the filing system?
If yes, the location is irrelevant. A DLL is registered before it can be
used: if it needs to be overwritten, it must be overwritten at the same
location.

If a user wants to work with another copy in another location, the DLL must
be unregistered and registered from the new location.

If you are using "Declare Function ...", your DLL is a WIN32 DLL. The other
kind is an ActiveX DLL. Both kinds require registration.

"jul" wrote:

I have a function in a dll (built in C) that is called through Excel VBA.

Currently I declare my function in VB as follows:
Declare Function MyFunction Lib "C:\MyDll.dll" (ByVal ...) as Integer

Yet, I would like the user to be able to specify the adress of the dll in
excel (via a message box or a cell).

How can I change the link "C:\MyDll.dll" in a dynamic way in VBA.

Many thanks in advance

Julien

  #2   Report Post  
Posted to microsoft.public.excel.programming
Jul Jul is offline
external usenet poster
 
Posts: 7
Default Using dll with a dynamic link in VB

In fact, I don't want the user to have access to the VB code. Yet, I want to
him to be able to choose where he wants to paste the dll on his computer (I
mean C:\\, or F:\\, ...).
So I wonder how he can from the Excel spreadsheet specify the location of
the dll (C:\\My documents...) to the VB code so that it changes the
declaration in VB (Declare Function MyFunction Lib "New adress")

thanks

"AA2e72E" wrote:

What do you mean by 'address'? Do you mean location within the filing system?
If yes, the location is irrelevant. A DLL is registered before it can be
used: if it needs to be overwritten, it must be overwritten at the same
location.

If a user wants to work with another copy in another location, the DLL must
be unregistered and registered from the new location.

If you are using "Declare Function ...", your DLL is a WIN32 DLL. The other
kind is an ActiveX DLL. Both kinds require registration.

"jul" wrote:

I have a function in a dll (built in C) that is called through Excel VBA.

Currently I declare my function in VB as follows:
Declare Function MyFunction Lib "C:\MyDll.dll" (ByVal ...) as Integer

Yet, I would like the user to be able to specify the adress of the dll in
excel (via a message box or a cell).

How can I change the link "C:\MyDll.dll" in a dynamic way in VBA.

Many thanks in advance

Julien

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 400
Default Using dll with a dynamic link in VB

If you are distributing the DLL to users, it does not matter where they
locate (copy to) the DLL (if other than in SYSTEM and SYSTEM32) provided that
they register it. The VBA code is not affected.

From your point of view, you might want a standard location for the DLL:
upgrade/support is much more straightforward if the location is the same for
all users--ideally on a network volume.

"jul" wrote:

In fact, I don't want the user to have access to the VB code. Yet, I want to
him to be able to choose where he wants to paste the dll on his computer (I
mean C:\\, or F:\\, ...).
So I wonder how he can from the Excel spreadsheet specify the location of
the dll (C:\\My documents...) to the VB code so that it changes the
declaration in VB (Declare Function MyFunction Lib "New adress")

thanks

"AA2e72E" wrote:

What do you mean by 'address'? Do you mean location within the filing system?
If yes, the location is irrelevant. A DLL is registered before it can be
used: if it needs to be overwritten, it must be overwritten at the same
location.

If a user wants to work with another copy in another location, the DLL must
be unregistered and registered from the new location.

If you are using "Declare Function ...", your DLL is a WIN32 DLL. The other
kind is an ActiveX DLL. Both kinds require registration.

"jul" wrote:

I have a function in a dll (built in C) that is called through Excel VBA.

Currently I declare my function in VB as follows:
Declare Function MyFunction Lib "C:\MyDll.dll" (ByVal ...) as Integer

Yet, I would like the user to be able to specify the adress of the dll in
excel (via a message box or a cell).

How can I change the link "C:\MyDll.dll" in a dynamic way in VBA.

Many thanks in advance

Julien

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 44
Default Using dll with a dynamic link in VB

Jul,

As far as I'm aware, you don't have to specify the path to the dll at all,
so long as it's registered properly. (Or part of the path, possibly?) So, I
would suggest anyone who uses your llibraries just put them in a system
folder and register them. That way your users can forget they exist. :)

-Mike

"jul" wrote in message
...
In fact, I don't want the user to have access to the VB code. Yet, I want

to
him to be able to choose where he wants to paste the dll on his computer

(I
mean C:\\, or F:\\, ...).
So I wonder how he can from the Excel spreadsheet specify the location of
the dll (C:\\My documents...) to the VB code so that it changes the
declaration in VB (Declare Function MyFunction Lib "New adress")

thanks

"AA2e72E" wrote:

What do you mean by 'address'? Do you mean location within the filing

system?
If yes, the location is irrelevant. A DLL is registered before it can be
used: if it needs to be overwritten, it must be overwritten at the same
location.

If a user wants to work with another copy in another location, the DLL

must
be unregistered and registered from the new location.

If you are using "Declare Function ...", your DLL is a WIN32 DLL. The

other
kind is an ActiveX DLL. Both kinds require registration.

"jul" wrote:

I have a function in a dll (built in C) that is called through Excel

VBA.

Currently I declare my function in VB as follows:
Declare Function MyFunction Lib "C:\MyDll.dll" (ByVal ...) as Integer

Yet, I would like the user to be able to specify the adress of the dll

in
excel (via a message box or a cell).

How can I change the link "C:\MyDll.dll" in a dynamic way in VBA.

Many thanks in advance

Julien



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Using dll with a dynamic link in VB

Both kinds require registration.

Standard Win32 DLLs don't require registration.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"AA2e72E" wrote in message
...
What do you mean by 'address'? Do you mean location within the
filing system?
If yes, the location is irrelevant. A DLL is registered before
it can be
used: if it needs to be overwritten, it must be overwritten at
the same
location.

If a user wants to work with another copy in another location,
the DLL must
be unregistered and registered from the new location.

If you are using "Declare Function ...", your DLL is a WIN32
DLL. The other
kind is an ActiveX DLL. Both kinds require registration.

"jul" wrote:

I have a function in a dll (built in C) that is called through
Excel VBA.

Currently I declare my function in VB as follows:
Declare Function MyFunction Lib "C:\MyDll.dll" (ByVal ...) as
Integer

Yet, I would like the user to be able to specify the adress of
the dll in
excel (via a message box or a cell).

How can I change the link "C:\MyDll.dll" in a dynamic way in
VBA.

Many thanks in advance

Julien



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
Dynamic Link to Quickbooks aMack Excel Worksheet Functions 2 September 2nd 08 05:55 PM
Dynamic link to website Rajan Iyer Excel Worksheet Functions 2 July 31st 07 08:45 AM
dynamic link Smat Excel Discussion (Misc queries) 2 September 14th 06 08:00 AM
dynamic link itay Links and Linking in Excel 1 February 25th 05 05:36 PM
Dynamic Link to SQL Mark Bigelow Excel Programming 2 July 30th 03 09:49 PM


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