I compiled with VS2017 on my PC (windows 10) a c++ DLL, that contains some routines. I loaded this file on Excel 2013 with the command
Private Declare Function Myfunc Lib "[PATH]\FILE.dll" (ByVal x As Double) As
Double
I do not use "alias" because I created a .DEF file in project folder. With these settings and on my PC, the loading works and I can use the DLL. I also tried to move the .dll file in some different directories on my PC, and in any case it works fine.
HOWEVER:
Problem 1:
it arises when I copy this DLL to another PC, which is an old Windows XP with Service Pack 3. Of course I already paid attention to compile in VS2017 C++ with "Platform v141_xp", SDK version 7.0 and predefined version of /clr.
The old PC contains Windows XP SP3, SDk 7.1, .NET Framework 4, C++ redistributable 2010, Office 2007 (update SP3).
When I try to import this DLL in XP with Office 2007, it returns the error
Error Run Time 53 It is not possible to find the file "[PATH]\File.dll"
Problem 2:
I try to make the same operation with another PC again. This time this PC is recent with Windows 10, Office 2013, C++ Red 2010, but not SDK.
The problem remains.
Error Run Time '53' etc...
What am I missing? I would like to use this DLL in any PC... is it possible?