Aspose公式存在列索引更改问题
本文关键字:问题 索引 存在 Aspose | 更新日期: 2023-09-27 17:58:16
我在windows(C#)应用程序中使用aspose 8.0.1.0。当我将列的公式设置为时
sheet1.Cells[3, 2].Formula = "='Supplies - Factor'!G757222";
公式自动更改为
"='Supplies - Factor'!G36326"
我已经使用调试器验证了它。如果我将公式设置为
"=‘供应商-系数’!G757222"
然后它自动变为
"=‘供应商-系数’!G36326"
知道为什么会发生这种事吗?
请尝试.NET v8.9.0的最新版本/修复程序:Aspose.Cells(您可以在此处下载)。请尝试将文件保存为XLSX或其他高级MS Excel文件格式(而不是旧的XLS)。我已经使用以下示例代码测试了您的场景/案例,它运行良好,公式插入正确,不会更改。例如示例代码:
//Instantiate a new workbook
Workbook workbook = new Workbook();
//Get the default worksheet (first worksheet)
Worksheet sheet1 = workbook.Worksheets[0];
sheet1.Name = "Supplies - Factor";
//Enter a value to the cell
sheet1.Cells["G757222"].PutValue("Testin...");
//Add the formula to the C4 cell
sheet1.Cells[3, 2].Formula = "='Supplies - Factor'!G757222";
//Save the Excel file
workbook.Save("e:''test2''out1formulatest1.xlsx", SaveFormat.Xlsx);
我在Aspose担任支持开发人员/福音传道者。