I am trying to open an excel file in .NET. I found the below code and I'm trying to use it but I'm receiving errors.
Application excel = new Application();
Workbook wb = excel.Workbooks.Open(path);
I'm using VS 2015.
Errors I'm receiving are:
1. Applicaion does not contain a constructor that takes 0 arguments.
2. Application' does not contain a definition for 'Workbooks' and no extension method 'Workbooks' accepting a first argument of type 'Application' could be found (are you missing a using directive or an assembly reference?)
I added Interop excel as a reference. v 15.