Skip to main content
Inspiring
June 15, 2018
Answered

unable to cast com object error

  • June 15, 2018
  • 1 reply
  • 5700 views

I have a script that has been working for years, then I think there was a windows update that broke it.  I am using vb.net and InDesign 2018.

The error I get is Unable to cast COM object of type 'System.__ComObject' to interface type 'InDesign.Application'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{ABD4CBB2-0CFE-11D1-801D-0060B03C02E4}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

This is only happening on some of my client machines that run this.  My development machine does not break.  The script is very simple it is just resizing text in text frames, so I will just post where it is failing (when it references the document).  It seems like the InDesign dll registrations in Windows have broken somehow.

Dim myIndesign As InDesign.Application = CreateObject("InDesign.Application.CC.2018")

myDocument = myIndesign.ActiveDocument

        myLayer = myDocument.Layers.Item("Layer 1")

        myTextFrames = myLayer.TextFrames.Count

        For myCounter = 1 To myTextFrames

Thanks for any help.

This topic has been closed for replies.
Correct answer mjelsner96

The link to the thread about registering the tlb file kind of worked.  If any of you have the problem again on Windows 10, here is what I had to do.

1. copy the regtlibv12.exe from a Windows 7 computer because it is not there in Windows 10

2. run the command C:\Windows\Microsoft.NET\Framework\v4.0.30319\regtlibv12.exe "C:\ProgramData\Adobe\InDesign\Version 9.0\de_DE\Scripting Support\9.0\Resources for Visual Basic.tlb"

3.  delete the resources.tlb file from c:\programdata\adobe\indesign\{versionx}\en_us\scripting support\{version}

4. run InDesign as administrator.

Now my script works again.

1 reply

Trevor:
Legend
June 17, 2018

To quote myself Re: InDesign CS6 scripts don't work on CC anymore

It sounds like you need to regenerated the .tlb files which are store somewhere like C:\ProgramData\Adobe\InDesign\Version 9.0\en_IL\Scripting Support\9.0

See more there, also see Re: Create Indesign.Application CC

mjelsner96AuthorCorrect answer
Inspiring
June 18, 2018

The link to the thread about registering the tlb file kind of worked.  If any of you have the problem again on Windows 10, here is what I had to do.

1. copy the regtlibv12.exe from a Windows 7 computer because it is not there in Windows 10

2. run the command C:\Windows\Microsoft.NET\Framework\v4.0.30319\regtlibv12.exe "C:\ProgramData\Adobe\InDesign\Version 9.0\de_DE\Scripting Support\9.0\Resources for Visual Basic.tlb"

3.  delete the resources.tlb file from c:\programdata\adobe\indesign\{versionx}\en_us\scripting support\{version}

4. run InDesign as administrator.

Now my script works again.

Trevor:
Legend
June 18, 2018

Did you try just deleting the .tbl so that it regenerates itself and in didn't work so you used the regtlibv12.exe method or did you go strait for the regtlibv12.exe method?