ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Lib parameter in Function Declare (https://www.excelbanter.com/excel-programming/390960-lib-parameter-function-declare.html)

ojv[_2_]

Lib parameter in Function Declare
 
I call a DLL in an addin using the

Declare Function xxx Lib yyy ....

I do not know the full name for the library until i have interrogated
registry. Is it somehow possible to set the full name for the library in the
Declare Function statement after I have started runnig the AddIn?

ojv

NickHK

Lib parameter in Function Declare
 
If you are asking how to call a function in a standard DLL, then you must
have the function name, library name and signature to make the declaration.
Unless you try the CALL worksheet function, but IIRC this was disable in
XL2K and later.

If it is an Addin that is installed, then you should know its functions.
If it is not installed, you can install it, but how do you know what it does
?

If this is an ActiveX DLL, you can use late binding, but you still need to
know what properties/methods it exposes.
Unless you work with CallByName and/or reading the Type Library etc.

Expalin more of which type this DLL is and how/why you only get the info
from the registry.

NickHK

"ojv" wrote in message
...
I call a DLL in an addin using the

Declare Function xxx Lib yyy ....

I do not know the full name for the library until i have interrogated
registry. Is it somehow possible to set the full name for the library in

the
Declare Function statement after I have started runnig the AddIn?

ojv




ojv[_2_]

Lib parameter in Function Declare
 
I have an application which is installed on a machine at a user defined
location. This application includes a dll which is used with an Excel addin
to import data from an SQLite database. When the application is installed on
a PC it writes to registry its location. I interrogate registry from the
Excel addin to get executables and launch them via the Shell function. This
works fine. But I do not understand how to do this with a DLL unless i know
the full file name - which I do not.

How would I use late binding to access a given function in the dll?

ojv



"NickHK" wrote:

If you are asking how to call a function in a standard DLL, then you must
have the function name, library name and signature to make the declaration.
Unless you try the CALL worksheet function, but IIRC this was disable in
XL2K and later.

If it is an Addin that is installed, then you should know its functions.
If it is not installed, you can install it, but how do you know what it does
?

If this is an ActiveX DLL, you can use late binding, but you still need to
know what properties/methods it exposes.
Unless you work with CallByName and/or reading the Type Library etc.

Expalin more of which type this DLL is and how/why you only get the info
from the registry.

NickHK

"ojv" wrote in message
...
I call a DLL in an addin using the

Declare Function xxx Lib yyy ....

I do not know the full name for the library until i have interrogated
registry. Is it somehow possible to set the full name for the library in

the
Declare Function statement after I have started runnig the AddIn?

ojv





Peter T

Lib parameter in Function Declare
 
Did you try the suggestion I gave yesterday to your similar post.

Regards,
Peter T

"ojv" wrote in message
...
I have an application which is installed on a machine at a user defined
location. This application includes a dll which is used with an Excel

addin
to import data from an SQLite database. When the application is installed

on
a PC it writes to registry its location. I interrogate registry from the
Excel addin to get executables and launch them via the Shell function.

This
works fine. But I do not understand how to do this with a DLL unless i

know
the full file name - which I do not.

How would I use late binding to access a given function in the dll?

ojv



"NickHK" wrote:

If you are asking how to call a function in a standard DLL, then you

must
have the function name, library name and signature to make the

declaration.
Unless you try the CALL worksheet function, but IIRC this was disable in
XL2K and later.

If it is an Addin that is installed, then you should know its functions.
If it is not installed, you can install it, but how do you know what it

does
?

If this is an ActiveX DLL, you can use late binding, but you still need

to
know what properties/methods it exposes.
Unless you work with CallByName and/or reading the Type Library etc.

Expalin more of which type this DLL is and how/why you only get the info
from the registry.

NickHK

"ojv" wrote in message
...
I call a DLL in an addin using the

Declare Function xxx Lib yyy ....

I do not know the full name for the library until i have interrogated
registry. Is it somehow possible to set the full name for the library

in
the
Declare Function statement after I have started runnig the AddIn?

ojv







ojv[_2_]

Lib parameter in Function Declare
 
Yes I have. Of course it worked. Thanks a lot.

ojv

"Peter T" wrote:

Did you try the suggestion I gave yesterday to your similar post.

Regards,
Peter T

"ojv" wrote in message
...
I have an application which is installed on a machine at a user defined
location. This application includes a dll which is used with an Excel

addin
to import data from an SQLite database. When the application is installed

on
a PC it writes to registry its location. I interrogate registry from the
Excel addin to get executables and launch them via the Shell function.

This
works fine. But I do not understand how to do this with a DLL unless i

know
the full file name - which I do not.

How would I use late binding to access a given function in the dll?

ojv



"NickHK" wrote:

If you are asking how to call a function in a standard DLL, then you

must
have the function name, library name and signature to make the

declaration.
Unless you try the CALL worksheet function, but IIRC this was disable in
XL2K and later.

If it is an Addin that is installed, then you should know its functions.
If it is not installed, you can install it, but how do you know what it

does
?

If this is an ActiveX DLL, you can use late binding, but you still need

to
know what properties/methods it exposes.
Unless you work with CallByName and/or reading the Type Library etc.

Expalin more of which type this DLL is and how/why you only get the info
from the registry.

NickHK

"ojv" wrote in message
...
I call a DLL in an addin using the

Declare Function xxx Lib yyy ....

I do not know the full name for the library until i have interrogated
registry. Is it somehow possible to set the full name for the library

in
the
Declare Function statement after I have started runnig the AddIn?

ojv








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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com