Hello,
I am currently working on an web application using ASP.NET Core (.NET Framework 7.0.103) in Windows 10 and utilizing Spire.Xls 12.7.0.
I am trying to create a Table of Contents page as I am looping through my data and one particular part I need is the show the sheet number so that when the workbook is printed my team can see what page different topics are on. I had built a similar application in VBA where I could utilize the =SHEET([value]) formula and I tried doing that in my C# web application but the output is just a syntax error (#NAME?), though when I click in the formula bar and press enter, the formula works and I see the correct sheet number. Code below:
Spire.Xls.Workbook workbook = new();
Spire.Xls.Worksheet index = workbook.Worksheets.Add("Index");
// create sheets
for (int i = 1; i < data.Count; i++)
{
Spire.Xls.Worksheet blank1 = workbook.Worksheets.Add(data[i].RowID.ToString());
index.Range[i, 4].Formula = "=SHEET(" + (char)34 + data[i].RowID + "-1" + (char)34 + ")";
}