Hello,
I am finding it extremely difficult to open an Excel workbook that I have saved in my bin. I am using Office 2010 and Visual Studio 2010. I have added the Microsoft.Office.Interop.Excel reference and a
Using Microsoft.Office.Interop.Excel statement.
My goal is to open a workbook, send all of the data to a datatable, do some searching for specific values then insert the chosen values to sql. The only part I can not due is is open the workbook. I can do it with csv file, but because of the nature of the data commas appear where I do not want them and I cannot control that.
Thank you,
RJ
Open an Excel Workbook
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Rodney Johnson78 reputationPosted Feb 20, 2012, 10:36 AM EST
Sam HobbsRank #107 · 20.5K reputationPosted Feb 20, 2012, 6:21 PM EST
You need to provide the path of the file as well a the filename. Just using "book1.xls" will not work unless the file is in the current directory for the executing application.