0

I have a c++ solution that generates an xll addin that works fine. OS is Windows 7 Enterprise 6.1 Build 7601 Service Pack1, compiler is Visual C++ 2010 Express and Excel is 2007 32bit. Notice that the sln uses boost libs. Now I have to update to Windows 10 version 1903 and Excel 365 with compiler Visual Studio 2019. After some painful times I managed to recompile the solution with no errors. When loading the addin from Excel I get the same behaviour as in C++ Excel Add-in loading error: XLL file is loaded by Excel as text file. However, I double checked that:

  1. sln is built in 32bit and Excel version is 32 bit
  2. all boost libs have been build in 32 bit
  3. I built under MDd and boost libs have been also built under MDd.

When using dependencies.exe to figure out if any dll is missing, I get "C:\Windows\SysWOW64\OLEAUT32.dll module has missing imports". Expanding the point I see that api-ms-win-core-wow64-l1-1-1.dll is missing. I also tried to open the xll on my old laptop with Windows7 and Excel 2007, and I get the same error, so I guess that it cannot really relate to dlls missing on new laptop and present on old one. I finally added to my PATH the variables SystemRoot%\system32%, %SystemRoot%, C:\Windows\System32 where the dlls are located, but still getting the same error.

Do you have any idea about possibile reasons for this behaviour?

Thanks for helping

EDIT: When compiling in release, Dependencies does not show any missing dll. However, also the Release xll shows the same error when loaded in Excel

user415893
  • 21
  • 2
  • Ignore *api-ms-win-core\** missing imports (although on older *Win* versions they will be a problem). Search for other missing files (e.g. *vcruntime140d.dll*). – CristiFati Aug 11 '20 at 13:10
  • Thanks for your comment. I do not have aby other missing import. When loading relase xll in dependency, I get no missing imports at all. I also explicitly checked vcruntime140.dll, and I see it is correctly loaded. – user415893 Aug 12 '20 at 09:44

1 Answers1

2

I noticed that when compiling the solution creating the xll I was receiving this warning "expected a string literal but found a user defined string literal instead". One line of the code was as follows

#define EXPORT comment(linker, "/EXPORT:"__FUNCTION__"="__FUNCDNAME__)

I edited the above as

#define EXPORT comment(linker, "/EXPORT:" __FUNCTION__ "=" __FUNCDNAME__)

(Notice whitespaces) and then everything worked fine

user415893
  • 21
  • 2