Error system.runtime.interop.services.COMException (0x800A148A)

Eddy Mouws 0 Reputation points
2023-02-07T16:01:47.2733333+00:00

Hi,

we use a custom built application. It's built in VB and uses Word to generate documents. It works in Word 2010 and Word 2013.

But we cannot upgrade to Word 2016 because it breaks the generation of documents.

We receive a "An unhandled exception has occurred in the application.". Clicking details gives a bunch of information but most detailed is : "system.runtime.interop.services.COMException (0x800A148A)".

How can we fix this ?

Kind regards,

Microsoft 365 and Office | Development | Other
Microsoft 365 and Office | Install, redeem, activate | For business | Windows
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Reza Aghaei 4,986 Reputation points MVP Volunteer Moderator
    2023-02-07T16:18:08.55+00:00

    You may want to embed the types of interop assemblies. This gives you independence from office version. To do so:

    1. Add a reference to the desired office interop assembly, for example Microsoft.Office.Interop.Word.dll
    2. Right click on the dll reference and choose properties
    3. In property window, set Embed Interop Types to true
    4. Set Copy to Output Directory to Always to make sure you distribute the assembly with our application
    5. Rebuild and distribute the new build on the target machines.

    For more information:

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.