This is a simple demo/template/framework which I will expand for my particular application.
In Visual Studio 2019, using C#, create a DLL with a function that does this
- Accepts parameter: Array of 10 numbers
- Has function "MySum" which sums the ten numbers and returns the total to the calling VBA
In Excel create an xlsm file with VBA that sends the array of ten arbitrary numbers to the DLL function and gets back the sum figure. The macro then shows the sum figure in a messagebox.
This is done entirely with code and does not require the VBA configuration to create a reference or registration for the dll. So the VBA code would include a "Declare Function" statement, or something like that.