I would like to have an endpoint in my .NET Core 3.1 API where I open an template Excel file, edit a few cells, and then return the edited Excel file as stream.
I thought I would use Microsoft.Office.Interop.Excel but when adding the reference via the Nuget packages I'm getting the following error:
Could not load file or assembly 'office, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'
After adding it as COM reference, I'm getting the following error:
Retrieving the COM class factory for component with CLSID {00020819-0000-0000-C000-000000000046} failed due to the following error: 80040154 Klasse is niet geregistreerd (0x80040154 (REGDB_E_CLASSNOTREG)).
I also don't want to save the edited template, it should be saved as stream so I can return the Excel stream.
Does somebody know if it is possible what I want to do, and yes, how?