I am getting error 430 "Class does not support Automation or does not support expected interface" when running this simple macro in the V5 visual basic editor.
Sub CATMain()
Dim Wins As Windows
Set Wins = CATIA.Windows 'This line throws error 430
End Sub
Sub CATMain()
Dim App As Application
Set App = CATIA 'this line runs fine
Dim Wins As Windows
Set Wins = App.Windows 'this line throws error 430
End Sub
I noticed that the issue arose when
I referenced the Windows object not when I
referenced the CATIA Application object. I looked at the V5
automation documentation and saw that the Windows object is part of
the InfInterfaces Framework and opened up the Tools>References
menu in the VBA editor and saw that the file path to
the CATIA INFInterfacesTLB Object
Library was not referencing the same
file path as my other V5 references.
CATIA INFInterfacesTLB Object Library Is located in C:\Program Files\Dassault Systemes\B421\win_b64\code\bin
My other V5 references are located in C:\Catia\B20B\win_b64\code\bin
I suspect that the issue is that VBA is trying to use 3DX versions of the library instead of the V5 version of the library since it is newer. Is there a way i can manually change the reference to the InfInterfaces library in the V5 folder without uninstalling 3DX?