VBA Error 430 but fixed when I modify the VBA program

37 Views Asked by At

I created a COM DLL for my VBA program and it works perfectly.
But when I create a new class and I add a second function in this class it gives me on VBA :

Error 430 : Class doesn't support Automation

To fix it I just have to modify the VBA program (by adding a empty line). I have this problem just on my computer and just for this file.

What can I do to prevent this error (without modifying my VBA program) ?

VBA code :

Sub main()

Dim DEMO_Lib As New Test_DLL.Class_TEST
MsgBox DEMO_Lib.Fct_4ssos_1

End Sub

COM DLL code (test) :

Imports System.Runtime.InteropServices

Namespace X
    <ClassInterface(ClassInterfaceType.AutoDual)>
    Public Class Class_TEST
        Public Function Fct_4ssos_1() As String
            Return "OUI"
        End Function

        Public Function Fct_4ssos_2() As String
            Return "NON"
        End Function

    End Class
End Namespace
0

There are 0 best solutions below