We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Getting Value from a cell has formula

Thread ID:

Created:

Updated:

Platform:

Replies:

20666 Oct 22,2004 04:39 AM Oct 23,2004 10:34 AM Windows Forms 4
loading
Tags: XlsIO
Mohammad Abdullah
Asked On October 22, 2004 04:39 AM

Hi.. I tried to get a value from a cell that has a formula in (Xls file) but I couldn''t , is there a way to get value from this type of cell. e.g. : suppose the cell has this formula : =sum(A11:A:22) ant this cell has value (223) , I want to store this value in a variable. Thank you

Administrator [Syncfusion]
Replied On October 22, 2004 06:58 AM

Hi Mohammmad, You can get the calculated value using IRange.FormulaNumberValue Code snippet -------------- IWorksheet mySheet = myWorkbook.Worksheets[0]; mySheet.Range["A1"].FormulaNumberValue Please let me know if you have any questions. Thanks. Best regards, Stephen. >Hi.. > > > I tried to get a value from a cell that has a formula in (Xls file) but I couldn''t , is there a way to get value from this type of cell. > >e.g. : suppose the cell has this formula : > >=sum(A11:A:22) >ant this cell has value (223) , I want to store this value in a variable. > >Thank you

Administrator [Syncfusion]
Replied On October 23, 2004 03:28 AM

Sorry but it gives me 0 No run time error, here is the code: ----- Dim Formula as Double Dim sheet As IWorksheet = myWorkBook.Worksheets(0) Formula = sheet.Range(I, 2).FormulaNumberValue >Hi Mohammmad, > >You can get the calculated value using IRange.FormulaNumberValue > >Code snippet >-------------- > >IWorksheet mySheet = myWorkbook.Worksheets[0]; >mySheet.Range["A1"].FormulaNumberValue > >Please let me know if you have any questions. Thanks. > >Best regards, > >Stephen. > >>Hi.. >> >> >> I tried to get a value from a cell that has a formula in (Xls file) but I couldn''t , is there a way to get value from this type of cell. >> >>e.g. : suppose the cell has this formula : >> >>=sum(A11:A:22) >>ant this cell has value (223) , I want to store this value in a variable. >> >>Thank you

Mohammad Abdullah
Replied On October 23, 2004 03:38 AM

Sorry but it gives me (0) No run time error, here is the code: ----- Dim Formula as Double Dim sheet As IWorksheet = myWorkBook.Worksheets(0) Formula = sheet.Range(I, 2).FormulaNumberValue >Hi Mohammmad, > >You can get the calculated value using IRange.FormulaNumberValue > >Code snippet >-------------- > >IWorksheet mySheet = myWorkbook.Worksheets[0]; >mySheet.Range["A1"].FormulaNumberValue > >Please let me know if you have any questions. Thanks. > >Best regards, > >Stephen. > >>Hi.. >> >> >> I tried to get a value from a cell that has a formula in (Xls file) but I couldn''t , is there a way to get value from this type of cell. >> >>e.g. : suppose the cell has this formula : >> >>=sum(A11:A:22) >>ant this cell has value (223) , I want to store this value in a variable. >> >>Thank you

Greg
Replied On October 23, 2004 10:34 AM

In attempting to not make many assumptions: 1) The formula in the first example is incorrect - too many colons. I imagine that''s just a forum typo. 2) If Excel didn''t write that xls, then there is no calculated value. i.e. ExcelRW does not evaluate any formulas, neither in writing nor reading. Good Luck, Greg

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;