How to execute excel formula from .net


#1

How to execute the formula of excel sheet from .net code?


#2

Hi,

Thanks for considering Aspose.

Well you may use Formula property of Aspose.Cells.Cell class.

Here is the sample code:

Workbook wb = new Workbook();

wb.Open(@"e:\testformula.xls");

Worksheet dataWs = wb.Worksheets[0];

dataWs.Cells["H8"].Formula ="=sum(e6:h6)";

wb.Save(@"e:\testformula1.xls");

Regards

Amjad Sahi

Aspose Nanjing Team