Shruti P
Shruti P

Reputation: 41

Could not load file/assembly 'office, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'. The system cannot find the file specified

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.

Upvotes: 0

Views: 2075

Answers (1)

Shruti P
Shruti P

Reputation: 41

I have resolved this issue by adding project reference (Project -> Add Project Reference -> Browse) to OFFICE.DLL present in the following folder: C:\Windows\assembly\GAC_MSIL\office\15.0.0.0__71e9bce111e9429c

Upvotes: 2

Related Questions