Why do i not get the forumlar shown by Excel?

Jan 30, 2013 at 11:25 AM


I'm trying to get the formular of a cell in a worksheet. I know that the formular looks like this:


FileInfo excelFile = new FileInfo(@"S:\test\Refs.xlsx");
ExcelPackage excelPackage = new ExcelPackage(excelFile);

ExcelWorksheet excelWorksheet = excelPackage.Workbook.Worksheets [1];
var result = excelWorksheet.Cells ["A1"].Formula;

// result ends up being:
// [1]Sheet1!A1

Why do i not get the whole formular? and why has the [source1.xlsx] been resolved to [1]?