How do I insert Structured References in Tables in Excel?
Using PutCellValue will just show the Formula on the screen.
Using Cells[].Formula will convert to #REF!
Trying something like: =SUM(TEST_TABLE[@[SCORE_1]:[SCORE_3]])
I attached the Excel template and VS solution.
++++++++++++++++++++++++++++++
Workbook wb = new Workbook(“C:\Users\wbrixon\Desktop\TEST_TEMPLATE.xlsx”);
Worksheet ws = wb.Worksheets[“TEST_SHEET”];
Cell cell = ws.Cells[“B3”];
ListObject table = cell.GetTable();
table.PutCellValue(1,0,“Dude Smith”);
table.PutCellValue(1, 1, “Do Stuff”);
table.PutCellValue(1, 2, 100);
table.PutCellValue(1, 3, 90);
table.PutCellValue(1, 4, 80);
table.PutCellValue(1, 5, “=SUM(TEST_TABLE[@[SCORE_1]:[SCORE_3]])”);
table.PutCellValue(2, 0, “Jane Smith”);
table.PutCellValue(2, 1, “Do MORE Stuff”);
table.PutCellValue(2, 2, 110);
table.PutCellValue(2, 3, 190);
table.PutCellValue(2, 4, 180);
ws.Cells[table.StartRow + 2, table.StartColumn + 5].Formula = “=SUM(TEST_TABLE[@[SCORE_1]:[SCORE_3]])”;
wb.CalculateFormula();