Regarding using Excel = Microsoft.Office.Interop.Excel

Matkawala, Mufaddal [CCC-OT NE] 0 Reputation points
2023-03-30T16:55:29.0233333+00:00

We have built DLL using 32 bit and when calling through application, we are getting error - "Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due to the following error: 80040154 Class not registered (Exception from h: 0x80040154 (REGDB_E_CLASSNOTREG))."

We have built DLL with following settings -

<TargetFramework>net472</TargetFramework>

<ImplicitUsings>enable</ImplicitUsings>

<Nullable>enable</Nullable>

<LangVersion>10.0</LangVersion>

<PlatformTarget>x86</PlatformTarget>

Also tried following on Windows Server-

C:\Windows\Microsoft.NET\Framework>%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\regasm.exe WSI.Xceptor.MergeExcelInputFiles.dll /regfile:mytest.reg

Microsoft .NET Framework Assembly Registration Utility version 4.8.3761.0

for Microsoft .NET Framework version 4.8.3761.0

Copyright (C) Microsoft Corporation. All rights reserved.

RegAsm : warning RA0000 : No registry script will be produced since there are no types to register

C:\Windows\Microsoft.NET\Framework>%SystemRoot%\Microsoft.NET\Framework\v4.0.30319\regasm.exe WSI.Xceptor.MergeExcelInputFiles.dll /tlb:mytest.tlb

Microsoft .NET Framework Assembly Registration Utility version 4.8.3761.0

for Microsoft .NET Framework version 4.8.3761.0

Copyright (C) Microsoft Corporation. All rights reserved.

Assembly exported to 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\mytest.tlb', and the type library was registered successfully

Please let me know steps to resolve the issue.

Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,532 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 56,931 Reputation points
    2023-03-30T17:30:59.7+00:00

    is Office actually installed? and do the bitness (32/64) match?