SwimMaster
SwimMaster

Reputation: 379

FileNotFoundException Could not load file or assembly 'office, Version=15.0.0.0

Im trying to parse a XLSM workbook,

I have linked using:

using Excel = Microsoft.Office.Interop.Excel;       //microsoft Excel 16 object in dependencies-> COM tab

Exception:

System.IO.FileNotFoundException
  HResult=0x80070002
  Message=Could not load file or assembly 'office, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'. The system cannot find the file specified.
  Source=TrafficDataPrep
  StackTrace:
   at TrafficDataPrep.XLSMReader.ReadXLSM() in C:...Program.cs:line 287
   at TrafficDataPrep.SplitFiles.Main() in C:...Program.cs:line 27

And in Dependencies > addReference > COM I added a reference to Interop.Microsoft.Office.Interop.Excel. Which should support my excel version, my excel version is 16.0.12527.21296

Followed this to link the assembly for Excel.

Any ideas why its still throwing the error?

Upvotes: 2

Views: 5853

Answers (1)

SwimMaster
SwimMaster

Reputation: 379

For some reason my .NET version was archaic. Updating to .NET 5 fixed the issue.

Upvotes: -1

Related Questions