0

I have a code in VB. how to write it in C#. This code is below:

Set server = CreateObject("FaconSvr.FaconServer")  
'Create the FaconServer object
server.OpenProject ("C:\Program Files\fatek\FaconSvr\Example\VB\DEMO.fcs")
'Open the project file(Demo.fcs)
ar.gorgin
  • 4,765
  • 12
  • 61
  • 100

1 Answers1

0
var obj = Activator.CreateInstance(Type.GetTypeFromProgID("FaconSvr.FaconServer"));
JohnyL
  • 6,894
  • 3
  • 22
  • 41
  • Thanks, But i get error : 'Value cannot be null. Parameter name: type' – ar.gorgin May 12 '18 at 11:28
  • Unfortunately, I get the same error message when trying to activate a "MyNamespace.MyClass" COM dll. I can call the COM object from VBA but not from C#. – Kevin Dec 21 '19 at 06:19