Calcolare le formule del workbook
Contents
[
Hide
]
Calcolare le formule del workbook
Si prega di utilizzare il metodo Workbook.CalculateFormula() per calcolare le formule del tuo workbook. Il seguente esempio di codice spiega l’uso di questo metodo.
Codice di Esempio
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
workbook, _ := NewWorkbook() | |
worksheets, _ := workbook.GetWorksheets() | |
worksheet, _ := worksheets.Get_Int(0) | |
cells, _ := worksheet.GetCells() | |
cell, _ := cells.Get_String("A1") | |
cell.PutValue_Int(5) | |
cell, _ = cells.Get_String("A2") | |
cell.PutValue_Int(15) | |
cell, _ = cells.Get_String("A3") | |
cell.PutValue_Int(25) | |
cell, _ = cells.Get_String("A4") | |
cell.SetFormula_String("=SUM(A1:A3)") | |
workbook.CalculateFormula() | |
value, _ := cell.Get_IntValue() | |
println(value) |
Output della console
Questo è l’output console del codice di esempio precedente.
Calculated Value of Cell A4: 45