0

I have a 32-bit dll which works on Windows 10. Now I need to build a 64-bit version of it which works on Microsoft 365. The code is written in C#.

For the current 32-bit dll, I do the following to build a dll and then xll.

  1. Find the dependencies by typing the following in Command Prompt: mvn -U process-resources
  2. In Visual Studio 2017, set Application / Build / Debug as in the following and build the solution:

Application Application

Build Build

Debug Debug

  1. After a successful build in Step 2, rebuild to create xll with the following Build Events setting:

Build Events BuildEvents

After the successful rebuild in Step 3, an xll file is created and it can be loaded from Excel 2016 on Windows 10 machines.

Now, I would like to create a 64-bit version of this (xll) that would work on Microsoft 365 machines. I have searched on the web and talked with my colleagues and they say that setting Platform to "Any CPU" will ensure the generated xll work in both 32-bit / 64-bit Excel. However, when I try to load the generated xll from Microsoft 365 Excel, it fails to be loaded. Would somebody kindly advise how I can make an xll that would work on Microsoft 365?

Attempt to build targeting x64 (added after jimcilhinney's suggestion)

I tried a build targeting x64. The build and rebuild were successful but either of Excel 2016 on Windows 10 nor 64-bit Excel on Microsoft 365 was not able to load the generated xll. Here's the steps I tried.

  1. Find the dependencies by typing the following in Command Prompt (same as above): mvn -U process-resources
  2. Set target to x64 from Configuration Manager:

Configuration Manager x64ConfigurationManager

Application (same as the above Application screenshot)

Build x64Build

Debug x64Debug

  1. Same as Step 3 in the above
Kyoto
  • 37
  • 5
  • 2
    "Microsoft 365" is a marketing/brand term for (formerly-known-as) Office-and/or-Windows-as-a-Service (_*ack!*_), it does not refer to any specific builds or editions or versions of Windows. Please clarify what your actual build target is. – Dai Jul 02 '23 at 01:38
  • Thanks Dai. I did not realize that. Let me check. – Kyoto Jul 02 '23 at 01:41
  • Excel version information says it is Microsoft Excel for Microsoft 365 MSO (version 2202 build 16.0.14931.20602) 64 bit. – Kyoto Jul 02 '23 at 01:54
  • If you change the target platform to x64, does it work then? – jmcilhinney Jul 02 '23 at 02:53
  • Hi. Thanks for your suggestion. Let me try when I get back. – Kyoto Jul 02 '23 at 03:04
  • Have added the result of changing the target platform to x64. – Kyoto Jul 02 '23 at 11:30
  • @Kyoto Hi, have you successfully created the xll after changing the target platform to x64? – wenbingeng-MSFT Jul 03 '23 at 07:45
  • Hi. Thank you for checking. An xll was successfully built but it was not loadable from Excel 2016 nor Microsoft 365 Excel as added in my original question. I only tried again so let me try again. Will report the outcome. – Kyoto Jul 03 '23 at 09:46
  • 1
    I tried again with the target platform x64. The xll was successfully built but, surprisingly, it is 32-bit. I checked this by running a 7-zip command as in [windows-command-to-tell-whether-a-dll-file-is-32-bit-or-64-bit](https://stackoverflow.com/questions/14560866/windows-command-to-tell-whether-a-dll-file-is-32-bit-or-64-bit) – Kyoto Jul 03 '23 at 10:50

0 Answers0