Spread Windows Forms 10.0 Product Documentation
GetFormula Method (SheetView)
Example 


Row index of the cell
Column index of the cell
Gets the formula of the specified cell on this sheet.
Syntax
'Declaration
 
Public Function GetFormula( _
   ByVal row As Integer, _
   ByVal column As Integer _
) As String
'Usage
 
Dim instance As SheetView
Dim row As Integer
Dim column As Integer
Dim value As String
 
value = instance.GetFormula(row, column)
public string GetFormula( 
   int row,
   int column
)

Parameters

row
Row index of the cell
column
Column index of the cell

Return Value

String with formula in the cell
Exceptions
ExceptionDescription
System.ArgumentOutOfRangeException Specified row index is out of range; must be between 0 and the total number of rows
System.ArgumentOutOfRangeException Specified column index is out of range; must be between 0 and the total number of columns
Remarks

For more information on formulas, refer to the Formula Reference.

Example
This example illustrates the use of this member by returning the formula for the specified cell.
fpSpread1.ActiveSheet.Cells[0, 0, 1, 1].Value = 20;
fpSpread1.ActiveSheet.SetFormula(2, 0, "Sum(A1,B1)"); 
object o;
o = fpSpread1.ActiveSheet.GetFormula(2, 0);
listBox1.Items.Add(o.ToString());
FpSpread1.ActiveSheet.Cells(0, 0, 1, 1).Value = 20
FpSpread1.ActiveSheet.SetFormula(2, 0, "Sum(A1,B1)")
Dim o As Object
o = FpSpread1.ActiveSheet.GetFormula(2, 0)
ListBox1.Items.Add(o.ToString())
Requirements

Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows Server 2012 R2, Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8, Windows 8.1, Windows 10

See Also

Reference

SheetView Class
SheetView Members

User-Task Documentation

Managing Formulas in Cells

 

 


Copyright © GrapeCity, inc. All rights reserved.