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.
Syncfusion Feedback

Getting Value from a cell has formula

Thread ID:

Created:

Updated:

Platform:

Replies:

20666 Oct 22,2004 08:39 AM UTC Oct 23,2004 02:34 PM UTC Windows Forms 4
loading
Tags: XlsIO
Mohammad Abdullah
Asked On October 22, 2004 08:39 AM UTC

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 10:58 AM UTC

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 07:28 AM UTC

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 07:38 AM UTC

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 02:34 PM UTC

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.

Warning Icon 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.Close Icon

;