This project has moved and is read-only. For the latest updates, please go here.

just open an excel and read some cells

Mar 17, 2015 at 8:02 PM
Hi,

I just want to open an Excel that already exists and read some fixed cells of the third worksheet.
for example: A5 and A6.

Sorry for the stupid question. I have been searching how to do it and I have not found it. With your libraries you can really do many things.

Kind regards,
Joan
Mar 18, 2015 at 12:50 PM
Edited Mar 18, 2015 at 3:35 PM
Try one of the examples in release folder.

Just like:

Excel.Application app = new Excel.Application();
var book = app.Workbooks.Add();
var sheet = book.Workseets[1] as Excel.WorkSheet;
var value = sheet.Cells["A5"].Value; // get value from A5


*Sebastian
Mar 18, 2015 at 3:26 PM
Thanks for the fast answer.

Yes, I have seen it in many examples. I thought it was creating an Excel from scratch. I mean to open an Excel, something like:

app.open("c:\ExcelFile.xsl");

Joan
Mar 18, 2015 at 3:34 PM
nearly correct. its:

Excel.Application app = new Excel.Application();
app.Workbooks.Open("C:\MyFiles\MyWorkbook.xls");

*Sebastian
Marked as answer by joanferrer on 3/18/2015 at 10:29 AM