//create a new workbook var workbook = new GrapeCity.Documents.Excel.Workbook(); var ws = workbook.Worksheets[0]; ws.Range["$B$1:$B$3"].Value = new object[,] { { "The implicit intersection operator @, evaluates an expression using implicit intersection. The formula can return a value, range, or error."}, { "Where value is a range, @ will return the value at the intersection of the row and column of the formula cell."}, { " Syntax: @value"} }; ws.Range["$B$8"].Value = "Item #"; ws.Range["$D$8"].Value = "@"; ws.Range["$G$10"].Value = " <--- error because intersection with multiple cells"; ws.Range["$E$21"].Value = " <--- error because no intersection"; // Apply table style. ITable table = ws.Tables.Add(ws.Range["B8:B18"], true); ITable table1 = ws.Tables.Add(ws.Range["D8:D18"], true); table.ConvertToRange(); table1.ConvertToRange(); ws.Range["$B$9"].Formula2 = "=SEQUENCE(10)"; ws.Range["$D$9:$D$18,$D$21"].Formula2 = "=@$B$9:$B$18"; ws.Range["$F$10"].Formula2 = "=@$B$10:$D$10"; // Save to an excel file workbook.Save("SingleOperator.xlsx");
' Create a new Workbook Dim workbook As New Workbook Dim ws = workbook.Worksheets(0) ws.Range("$B$1:$B$3").Value = New Object(,) { {"The implicit intersection operator @, evaluates an expression using implicit intersection. The formula can return a value, range, or error."}, {"Where value is a range, @ will return the value at the intersection of the row and column of the formula cell."}, {" Syntax: @value"} } ' Apply table style. Dim table As ITable = ws.Tables.Add(ws.Range("B8:B18"), True) Dim table1 As ITable = ws.Tables.Add(ws.Range("D8:D18"), True) table.ConvertToRange() table1.ConvertToRange() With ws.Range !B8.Value = "Item #" !D8.Value = "@" !G10.Value = " <--- error because intersection with multiple cells" !E21.Value = " <--- error because no intersection" !B9.Formula2 = "=SEQUENCE(10)" .Item("$D$9:$D$18,$D$21").Formula2 = "=@$B$9:$B$18" !F10.Formula2 = "=@$B$10:$D$10" End With ' save to an excel file workbook.Save("SingleOperator.xlsx")