Hello
I need to develope an application that will call each tab in my Excel spreadsheet...1 at a time and read data from rows/columns
Example:
Sheet1 is called and data is read from the Sheet1 into Visual Studio
Next call Sheet2 and data is read from the Sheet2 into Visual Studio
Next call Sheet3 and data is read from the Sheet3 into Visual Studio .....and so on
thanks
J
Loading

Amit ChoudharyRank #145 · 15.8K reputationPosted Feb 19, 2010, 5:43 AM EST
i can help you but you have to wait for some time i have done this before accessing sheets of excel seperately and modifying column.
wait for some time i'll come up with a solution for you.
j l68 reputationPosted Feb 19, 2010, 5:51 AM EST
J
Amit ChoudharyRank #145 · 15.8K reputationPosted Feb 21, 2010, 8:34 PM EST
I have attach the project download it and see how it works.
if you have Excel-07 format of Sheets then you have to change the ConnectionString to below:
string excelConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;" +
@"Data Source=" + Server.MapPath("~/App_Data/PhraseContentFiles/" + filename + "") + ";" +
"Extended Properties=\"Excel 12.0;HDR=YES\";";
All the Best.
Please don't forget to mark the answer.
j l68 reputationPosted Feb 26, 2010, 11:42 AM EST
Make sure you Include References:
Add the Excel Interop Reference Library in your project , AND also include the statement .......using Microsoft.Office.Interop.Excel;
Define Excel Object :
Microsoft.Office.Interop.Excel._Application ExcelApp = new Microsoft.Office.Interop.Excel.Application();
Open WorkBook and Call your Tab:
string myPath = @"C:\Excel.xls";
ExcelApp.Workbooks.Open(myPath);
ExcelApp.Worksheets["MyTAB"].Select();