Reading from Excel dynamically in C# -


i'm not sure if using word "dynamic" correct. anyway, have basic understanding of using microsoft.office.interop.excel. problem is, i'm having 100 excel files in folder, each of excel files has different sheet name, number of rows , number of columns.

as far understand, need specify range , sheet name, i.e.:

xcel.worksheet sheet = someexcelfiles.sheets["somesheetname"] excel.worksheet;  excel.range range = sheet.get_range("a1:a5"); 

is there anyway application can read data in of excel files without having specify sheet name , range (row , columns)?

short answer yes. long answer dotnetperls contains grabbing number of sheets programatically.

range excelrange = sheet.usedrange; object[,] valuearray = (object[,])excelrange.get_value(     xlrangevaluedatatype.xlrangevaluedefault); 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -