I\'m using VSTS 2K8 and I\'ve set up a Unit Test Project. In it, I have a test class with a method that does a simple assertion. I\'m using an Excel 2007 spreadsheet as my
I had two problems here, one was the miss-spelling of the desired sheet in my excel file. The other one and I think the important one was the difference between the .xls
and .xlsx
files. In my machine I have the Office 2007 so automatically the extension of excel files is .xlsx
, but I was supposed to write a test case for a project that has been already implemented and it was using this DataSource:
[DataSource("System.Data.Odbc",
@"Driver={Microsoft Excel Driver (*.xls)};DriverId=790;Dbq=Test.xls;DefaultDir=.",
"Data$", DataAccessMethod.Sequential)]
I created an excel file in a machine that had the Office version before 2007 so the extension was .xls
and then I moved this excel file to my machine. This way I could solve my problem.