View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default problem with "file not found" calling a dll from VBA

How are you declaring the function and where is the dll. If the full path is
not included in the declaration is the dll in one of the places that
automatically get searched, eg the system32 folder. Or are you doing a ChDir
to the path before calling.

Regards,
Peter T

"Brian Murphy" wrote in message
...
I'm going nuts!
From VBA I call a routine in a DLL which was compiled with visual
studio (language is fortran)
It works fine on some computers, but on others it throws up a

Run-time error '53':
File not found: myfilename.dll

It does this even though the dll file is quite definitely there.
A small program compiled with VB6 to do what VBA does behaves the same
way.

In the VB code if I change the name of the routine being called to a
name that is not in the dll, the same error message is displayed.

Something is messed up somewhere, but I just can't figure out what it
is!@#$%

Has anyone encountered this problem, and know how to solve it? I'm
desperate.

The problem can happen with either XP or Vista, and with either excel
2003 or excel 2007.

Thanks,

Brian