I am using VS 2022 to develop windows application. In which I want to write some data into Excel. I have installed NuGet package Microsoft.Office.Interop.Excel Version 15.0.4795.1001 and I have Microsoft Excel 2019. And I am using dot net Framework 6.0.
My project is working fine until the excel part comes. I can see the assembly file in bin folder of my project for version 15.0.4795.1001, but the error occurring is for version 15.0.0.0.
Please help me to solve this issue.
I have tried to give COM reference Microsoft Office 16.0 Object Library but the Excel is conflicting between COM reference and NuGet package.
I have tried installing Microsoft Excel 2010 but still same error is occurring.
I have tried to update Microsoft.Office.Interop.Excel Version 14.0.0.1, same error is continued.