Export to excel .xlsx failed component with CLSID windows 10iot

Kran2022 386 Reputation points
2023-01-06T09:10:01.01+00:00

Hi All: Good morning_

On my system with MS Office installed no issues in exporting to excel .xlsx but when i tried with other systems with Windows 10 LTSB ioT 1607 os build 14393.5006 no mS Office installed; using my app when i trioed to exporto to excel file, i'm getting below error message: Retriving the com class factor for component with CLSID

I set VS 2019 project properties & solution properties to 32bit...i couldn't find any solution. Any help? How can i fix this?

Reference dll/libraries:
276861-image.png

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
10,697 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,306 questions
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

Accepted answer
  1. Jack J Jun 24,296 Reputation points Microsoft Vendor
    2023-01-09T06:23:47.753+00:00

    @Kran2022 , Welcome to Microsoft Q&A, as usual, we could not use the Micosoft.Office.Interop.Excel assembly if we don't install the office software.

    And if you want to export to excel without installing the office software, you could try to use DocumentFormat.OpenXml to do what you wanted.

    I provided an answer in the question and you could check if it is useful for you.

    Best Regards,
    Jack


    If the answer is the right solution, please click "Accept Answer" and upvote it.If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.
    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. RLWA32 40,771 Reputation points
    2023-01-06T11:11:19.98+00:00

    no mS Office installed

    COM interop with any Office application requires that application to be installed.


  2. Limitless Technology 43,966 Reputation points
    2023-01-06T15:55:53.59+00:00

    Hello there,

    Changing the application pool to "Enable 32-Bit Applications" resolved the issue for some users.

    Also building your solution against x86 will force your service to run as 32-bit.

    This might need resourceful https://learn.microsoft.com/en-us/visualstudio/vsto/how-to-target-office-applications-through-primary-interop-assemblies?view=vs-2022


    --If the reply is helpful, please Upvote and Accept it as an answer--