@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.