2016-07-22 32 views
0

我在Windows(C#)應用程序中使用aspose 8.0.1.0。當我設置公式爲列作爲具有列索引更改問題的Aspose公式

sheet1.Cells[3, 2].Formula = "='Supplies - Factor'!G757222"; 

式自動變爲

"='Supplies - Factor'!G36326" 

我已經使用調試器驗證它。如果我設置公式

「= '供應 - 因子'!G757222」

然後,它會自動變爲

「= '供應 - 因子' G36326!」

任何想法爲什麼會發生這種情況?

回答

1

請嘗試最新版本/修復:Aspose.Cells for .NET v8.9.0(您可以下載它here)。請嘗試將文件保存爲XLSX或其他高級MS Excel文件格式(而不是舊版XLS)。我已經使用下面的示例代碼測試了您的場景/案例,它工作正常,公式插入正確並且不會更改。 e.g 示例代碼:

//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。

+0

謝謝@Amjad。此問題已在最新版本中解決。 –