• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

unable to cast com object error

Community Beginner ,
Jun 15, 2018 Jun 15, 2018

Copy link to clipboard

Copied

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.

TOPICS
Scripting

Views

3.9K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Beginner , Jun 18, 2018 Jun 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}

...

Votes

Translate

Translate
Guru ,
Jun 17, 2018 Jun 17, 2018

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 18, 2018 Jun 18, 2018

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Jun 18, 2018 Jun 18, 2018

Copy link to clipboard

Copied

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 18, 2018 Jun 18, 2018

Copy link to clipboard

Copied

I tried deleting the tlb first, but that didn't take care of the issue.  That has resolved my issue in the past, but this time after the most recent set of windows updates it didn't seem to take care of the issue w/o registering the tlb.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guru ,
Jun 18, 2018 Jun 18, 2018

Copy link to clipboard

Copied

Thanks, I marked your answer as correct, you can now mark mine as helpful

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 22, 2023 Jun 22, 2023

Copy link to clipboard

Copied

The above issue happened to me. There is no such C:ProgramData folder not found in my system. I have using VS2019 and adobe Indesign CS6. I want to open a IDML file and load an XML. Kindly suggest me. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 23, 2023 Jun 23, 2023

Copy link to clipboard

Copied

Did you try locating the tlb file on your machine, deleting it if found, and then lauching InDesign as admin so that the tlb file is regenerated? If this does not help you then create a new post as this is a very old post and you would not get much help on this one.

-Manan

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 24, 2023 Jun 24, 2023

Copy link to clipboard

Copied

I'm pretty sure running InDesign as admin ONLY re-creates TLB file - but doesn't register it in the system. 

 

@Aysha27550661f9sm this is original place for the tool - links to ZIPs no longer work:

 

http://www.vbaccelerator.com/home/VB/Utilities/Type_Library_Registration_Utility/VB6_Register_TypeLi...

 

And here is a copy with working ZIPs:

 

https://github.com/tannerhelland/vbAccelerator-Archive/tree/master/VB/Utilities/Type_Library_Registr...

 

Remember to run this utility as admin to let it properly register TLB file in the system. 

 

▒► ID-Tasker / ID-Tasker Server - work smart not hard ◄▒

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 25, 2023 Jun 25, 2023

Copy link to clipboard

Copied

LATEST

Thanks for the insight @Robert Tkaczyk. In my limited experience so far with using InDesign tlb file, I never had to register it explicitly.

-Manan

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines