View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default Calling DLL functions in Excel VBA

I expected that it would work if the dll file and the excel file are
in the same folder.


Not sure but try this

sCurDir = CurDir
ChDir ThisWorkbook.Path
nResult = currentMilli
ChDir sCurDir

Regards,
Peter T

"sunny" wrote in message
ups.com...
I made a dll and I used it in VBA
Like this:
Declare Function currentMilli Lib "exceltest.dll" () As Long

It's working on my computer in any folders.
But when I tried it on other's computer it worked only in the "My
documents" folder.
I expected that it would work if the dll file and the excel file are
in the same folder.
What on earth is going on? How can I make it available on other's
computer in any folders?
Thanks in advance.