Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Direct DLL reference?
Is there a way, using VBA to directly reference a DLL?
Please note, I'm NOT looking for code that selects a reference in Tools then References, but instead allows a direct DLL call. If so, your example code would be appreciated. Thanks much. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Direct DLL reference?
See the Declare statement. E.g.,
Public Declare Function MyFunction Lib "FileName.dll" (Args As Whatever) As Long Sub AAA() Dim Res As Long Res = MyFunction(123,456) End Sub Note that (1) you cannot call functions in a DLL created in VB with this syntax. VB can create only ActiveX DLLs that must be created as objects. (2) the DLL function must have been compiled with the __stdcall directive, (3) the function must have been included in the DEF file. -- Cordially, Chip Pearson Microsoft MVP - Excel, 10 Years Pearson Software Consulting www.cpearson.com (email on the web site) "XP" wrote in message ... Is there a way, using VBA to directly reference a DLL? Please note, I'm NOT looking for code that selects a reference in Tools then References, but instead allows a direct DLL call. If so, your example code would be appreciated. Thanks much. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Direct Formula | Excel Discussion (Misc queries) | |||
Direct to sheet | Excel Discussion (Misc queries) | |||
Can you direct me. | Excel Discussion (Misc queries) | |||
Direct Precedents of a cell | Excel Programming | |||
Direct reference | Excel Worksheet Functions |