0

I'm attempting to use the following ExcelReader library:

http://exceldatareader.codeplex.com/

The code example shows:

//1. Reading from a binary Excel file ('97-2003 format; *.xls)
IExcelDataReader excelReader = ExcelReaderFactory.CreateBinaryReader(stream);

My application is (unfortunately) in VB.NET. I've wrote the following:

Dim excelReader as IExcelDataReader

However I just get "IExcelDataReader is undefined".

I've tried importing Excel.dll by doing:

Imports Excel

But again I just get an error.

Why is this? How can I reference this library?

Curtis
  • 101,612
  • 66
  • 270
  • 352

2 Answers2

0

By any chance, is your project defined as .NET 4.0 client profile? If so change it to full .NET 4.0.

Aliostad
  • 80,612
  • 21
  • 160
  • 208
  • I don't get an error when importing (although intellisense hasn't picked it up). But I do when entering my first line of code, `Type 'IExcelDataReader' is not defined.` – Curtis Apr 04 '12 at 10:35
  • Thanks for the update. My application is running in .NET 3.5. Sorry I should've specified that – Curtis Apr 04 '12 at 10:48
0

Try this

Dim excelReader As IExcelDataReader = ExcelReaderFactory.CreateBinaryReader(stream)
MACMAN
  • 1,883
  • 1
  • 21
  • 35
  • The issue is that the application isn't recognising `IExcelDataReader` – Curtis Apr 04 '12 at 10:48
  • May be it's the framework it's created for .Net Framework 2 Change the framework reference to 2.0 for this project and try. – MACMAN Apr 04 '12 at 11:01