SilverShaded
Well-known member
- Joined
- Mar 7, 2020
- Messages
- 110
- Programming Experience
- 10+
My COM DLLs are not longer working from excel. (as far as i can tell its after installing .Net5 or .Net6 preview). The DLL is still created using .Net 4.8. The same code is working on a diferent VM.
The DLL is recognised by excel and so are the functions defined int he DLL. Howvere the code will not execute, the VBA just stops when it reached the call to the DLL fucntion.
Register COMinterop is set to true
Heres an Exacmple Code;
The DLL is recognised by excel and so are the functions defined int he DLL. Howvere the code will not execute, the VBA just stops when it reached the call to the DLL fucntion.
Register COMinterop is set to true
Heres an Exacmple Code;
C#:
using System;
using System.Runtime.InteropServices;
namespace TestCOM
{
[Guid("A3E6B57A-E794-439B-AE96-ADED4D89F991")]
[ComVisible(true)]
[ClassInterface(ClassInterfaceType.AutoDual)]
public class Class1
{
public double test()
{
return 999;
}
}
}
Code:
Dim test1 As New TestCOM.Class1
Function test2() As Double
test2 = test1.test()
End Function