Dll functions 
Author Message
 Dll functions

Hello Simas,

Try the following VBA:

Sub test()
Dim oFunctions As MSOWCFLib.OCATP
Set oFunctions = New MSOWCFLib.OCATP

Dim NewDate As Date
NewDate = oFunctions.EDATE(Date, 1) ' 1 month from today
MsgBox Format(NewDate, "MM/DD/YYYY")

Set oFunctions = Nothing
End Sub

The trick is to create an object from the dll, which is what the New
keyword does for us.  Then we release that object when we are finished with
the library, by setting the variable to Nothing.  I chose the variable name
oFunctions but you can chose your own variable name.

HTH.

Best regards,
 Greg Ellison
 Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.

Are you secure? For information about the Microsoft Strategic Technology
Protection Program and to order your FREE Security Tool Kit, please visit
http://www.*-*-*.com/

--------------------

Quote:

>I want to use the EDATE function in Access VBA but i dont
>know how.
>The references to MSOWCF.Dll (the dll with the functions i
>want) are already in place and i can see the functions
>with the object browser.
>There must be something else i have to in order to make it
>work.
>Thanks for the replies.



Mon, 14 Feb 2005 03:46:26 GMT  
 Dll functions

Greg Ellison

Many thanks to you.
I knew that the problem was creating the object.
I kept on trying with the "createobject" function but now
it works just perfect.

Once again thank you very much.



Mon, 14 Feb 2005 17:49:09 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. VB5 DLL function / Can't find DLL entry point

2. DLL function to unregister a DLL?

3. DLL handle & DLL Function handle

4. dll functions without declare statement (XLL for Access)?

5. Problems finding VBA322.dll functions from a copy of an MS Access database

6. Please Help - USER32.DLL function list.

7. Trouble calling custom dll functions from 2.0

8. dll function description

9. how to call a dll function in vba

10. User32.dll Function

11. .dll functions

12. Declaring DLL-functions

 

 
Powered by phpBB® Forum Software