Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
XP XP is offline
external usenet poster
 
Posts: 389
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default 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
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
Direct Formula Rechie Excel Discussion (Misc queries) 7 October 20th 09 10:48 AM
Direct to sheet Gazz_85[_2_] Excel Discussion (Misc queries) 2 July 10th 09 12:08 PM
Can you direct me. Baha Excel Discussion (Misc queries) 3 June 22nd 07 08:56 AM
Direct Precedents of a cell jdcox1999 Excel Programming 4 October 4th 06 06:39 PM
Direct reference Archana Excel Worksheet Functions 1 August 31st 06 07:44 AM


All times are GMT +1. The time now is 08:20 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"