0

I am trying to get Data from an Excel File with vb.net. I am using VS2019, Excel 2019 and the Microsoft Excel 16.0 Object Library. When I try to run my code I get the following error:

System.IO.FileNotFoundException HResult=0x80070002 Nachricht = Could not load file or assembly 'office, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'.

This is how I try to access Excel:

Dim excelApp As New Microsoft.Office.Interop.Excel.Application
Dim worksheet As Microsoft.Office.Interop.Excel.Worksheet
Dim workbook As Microsoft.Office.Interop.Excel.Workbook
Dim excelLength As Integer

While I did not find anything specific to my situation it looks like the problem might stem from a incompatible version, but I'm not sure if it is my version of Excel or the COM-Object I'm using.

2
  • check here stackoverflow.com/questions/14527305/…
    – Yogesh
    Feb 12, 2021 at 12:25
  • Depending on what your doing, might find it more reliable to use oledb or one of the may prebuilt excel libraries rather than relying on office interops
    – Hursey
    Feb 12, 2021 at 20:39

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.