So, for this if you have installed Microsoft.Office.Interop.Excel nuget package. First you need to uninstall it from you package section. To resolve the issue, we need to install Com Component Interop.Microsoft.Office.Interop.Excel. to install follow the step. Right click on Dependencies folder and select "Add COM Reference" as shown below.
Now in this window search for "Excel". In search result you will get com library reference. Refer the below screenshot in this you need to select "Microsoft Excel 16.0 Object Library". You can select version as per you project requirement.
<ItemGroup>
<COMReference Include="Microsoft.Office.Interop.Excel">
<WrapperTool>tlbimp</WrapperTool>
<VersionMinor>9</VersionMinor>
<VersionMajor>1</VersionMajor>
<Guid>00020813-0000-0000-c000-000000000046</Guid>
<Lcid>0</Lcid>
<Isolated>false</Isolated>
<EmbedInteropTypes>true</EmbedInteropTypes>
</COMReference>
</ItemGroup>
Happy coding...... 😊