private void Form1_Load(object sender, EventArgs e)
{
// fpSpread2のワークブックを取得します
GrapeCity.Spreadsheet.IWorkbook workbook2 = fpSpread2.AsWorkbook();
// workbook2をfpSpread1のワークブックセットに追加します。
GrapeCity.Spreadsheet.IWorkbookSet workbookSet1 = fpSpread1.AsWorkbook().WorkbookSet;
workbookSet1.Workbooks.Add(workbook2);
// テストデータを設定します
fpSpread2.ActiveSheet.SetValue(0, 0, 10);
fpSpread2.ActiveSheet.SetValue(1, 0, 20);
fpSpread2.ActiveSheet.SetValue(2, 0, 30);
fpSpread2.ActiveSheet.SetValue(3, 0, 40);
fpSpread2.ActiveSheet.SetValue(4, 0, 50);
// fpSpread2を参照したSUM関数を設定します
fpSpread1.ActiveSheet.SetFormula(0, 0, "SUM([fpSpread2]Sheet1!A1:A5)");
}
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
' fpSpread2のワークブックを取得します
Dim workbook2 As GrapeCity.Spreadsheet.IWorkbook = FpSpread2.AsWorkbook()
' workbook2をfpSpread1のワークブックセットに追加します
Dim workbookSet1 As GrapeCity.Spreadsheet.IWorkbookSet = FpSpread1.AsWorkbook().WorkbookSet
workbookSet1.Workbooks.Add(workbook2)
' テストデータを設定します
FpSpread2.ActiveSheet.SetValue(0, 0, 10)
FpSpread2.ActiveSheet.SetValue(1, 0, 20)
FpSpread2.ActiveSheet.SetValue(2, 0, 30)
FpSpread2.ActiveSheet.SetValue(3, 0, 40)
FpSpread2.ActiveSheet.SetValue(4, 0, 50)
' fpSpread2を参照したSUM関数を設定します
FpSpread1.ActiveSheet.SetFormula(0, 0, "SUM([fpSpread2]Sheet1!A1:A5)")
End Sub