Skip to main content
Known Participant
October 6, 2021
Answered

How to solve 0x80004002 error on Illustrator 2020/2021 COM with C#?

  • October 6, 2021
  • 1 reply
  • 1241 views

Hi!

I'm trying to connect my C# application to Illustrator 2020 (or 2021). I added a reference to the interop.illustrator DLL but no matter if I try:

Type oType = Type.GetTypeFromProgID("Illustrator.Application.24");
dynamic il = Activator.CreateInstance(oType);

or

Illustrator.Application il = new Illustrator.Application();

I always run into a 0x80004002 error (E_NOINTERFACE). In the past this could be solved by just running Illustrator as Administrator once to create/register the type library. However, this doesn't seem to work anymore. I tried registering the interop DLLs and scriptingsupport.aip manually, but that doesn't seem to work either. Did the COM interface become deprecated may be?

Any help here would be highly appreciated.

 

Thanks in advance,

Hans

 

This topic has been closed for replies.
Correct answer CarlosCanto

I just tried. It was my first attempt in VBA but I think I got it right. The result is a runtime error 429 "Object creation by ActiveX component not possible" (translated from german error message)


ok, have you tried running Illustrator and excel as Administrator?

 

if so, try disabling your antivirus, security software, firewalls etc, those might be preventing ActiveX from doing malicious stuff.

 

other than that I don't know what else to do, it's probably not Illustrator or C# but the OS blocking ActiveX in general.

 

...perhaps reinstalling?

1 reply

CarlosCanto
Community Expert
Community Expert
October 7, 2021

No, the COM interface still works

 

I'm not familiar with C#, but in VBA this works fine

 

Set iapp = GetObject(, "Illustrator.Application.24")

HansSH04Author
Known Participant
October 7, 2021

Thanks Carlos, it's good to know that it should still work. I don't think the issue is anywhere in my application (that's been running fine with previous versions of Illustrator for a decade or so) but something that isn't registered in system properly. The weird part is that it happens in the same way both here and at my customer.

 

CarlosCanto
Community Expert
Community Expert
October 7, 2021

do you have Excel? give it a try just to make sure the Illustrator install is ok and the issue is on the C# side

 

you could also try with vbs, it should work, or not?