M
Marc
Hi,
I'm developping an application using a macro (in Excel) and a DLL that I
wrote.
The problem is that when I'm trying to declare my function from the DLL in
my macro, I've got an Runtime Error 53 : File not found 'MyAPI.dll' .
Apparently, VBA does not find the DLL if I don't give the full path in the
declaration or if the DLL is not the in the system folder.
In fact, I would be better if the DLL can be in the XLS folder or in a
subfolder (called DLL\ for example![Smile :) :)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
## WORKS (If the DLL is the system folder)
Declare Function generateData Lib "MyAPI.dll" _
Alias "GenerateData" ( _
ByVal strTargetOutputFile As String, _
ByVal strInputFileName As String, _
ByVal strGeneratedStructName As String) _
As Long
## WORKS (Full path)
Declare Function generateData Lib "D:\_MyTemp_\MyAPI\Debug\MyAPI.dll" _
Alias "GenerateData" ( _
ByVal strTargetOutputFile As String, _
ByVal strInputFileName As String, _
ByVal strGeneratedStructName As String) _
As Long
## If the DLL is in the same folder that the XLS containing the macro
Does anybody have any solution or workaround ?
Thanks in advance,
Marc
I'm developping an application using a macro (in Excel) and a DLL that I
wrote.
The problem is that when I'm trying to declare my function from the DLL in
my macro, I've got an Runtime Error 53 : File not found 'MyAPI.dll' .
Apparently, VBA does not find the DLL if I don't give the full path in the
declaration or if the DLL is not the in the system folder.
In fact, I would be better if the DLL can be in the XLS folder or in a
subfolder (called DLL\ for example
## WORKS (If the DLL is the system folder)
Declare Function generateData Lib "MyAPI.dll" _
Alias "GenerateData" ( _
ByVal strTargetOutputFile As String, _
ByVal strInputFileName As String, _
ByVal strGeneratedStructName As String) _
As Long
## WORKS (Full path)
Declare Function generateData Lib "D:\_MyTemp_\MyAPI\Debug\MyAPI.dll" _
Alias "GenerateData" ( _
ByVal strTargetOutputFile As String, _
ByVal strInputFileName As String, _
ByVal strGeneratedStructName As String) _
As Long
## If the DLL is in the same folder that the XLS containing the macro
Does anybody have any solution or workaround ?
Thanks in advance,
Marc