Aspose.Cells te FormulaText Fonksiyonu Kullanma
Contents
[
Hide
]
FormulaText, Excel 2013 ve sonrası bir fonksiyondur. Önceki sürümler, Excel 2010 veya 2007 gibi, tarafından desteklenmez. Adından da anlaşılacağı gibi, belirli bir hücrede bulunan formülün metnini yazdırır. Bu makale, Aspose.Cells kullanarak bu fonksiyonun nasıl kullanılacağını gösterecektir.
Aşağıdaki örnek kod, Aspose.Cells ile FormulaText kullanımını gösterir. Kod önce hücre A1’e bir formül yazar ve sonra A2 hücresinde FormulaText’i kullanarak formülün metnini yazdırır.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
// Create a workbook object | |
Workbook workbook = new Workbook(); | |
// Access first worksheet | |
Worksheet worksheet = workbook.Worksheets[0]; | |
// Put some formula in cell A1 | |
Cell cellA1 = worksheet.Cells["A1"]; | |
cellA1.Formula = "=Sum(B1:B10)"; | |
// Get the text of the formula in cell A2 using FORMULATEXT function | |
Cell cellA2 = worksheet.Cells["A2"]; | |
cellA2.Formula = "=FormulaText(A1)"; | |
// Calculate the workbook | |
workbook.CalculateFormula(); | |
// Print the results of A2, It will now print the text of the formula inside cell A1 | |
Console.WriteLine(cellA2.StringValue); |
Konsol Çıktısı
Yukarıdaki örnek kodun konsol çıktısı burada gösterilmektedir.
=SUM(B1:B10)
Aspose.Cells kitaplığını kullanarak Microsoft Excel de bir dizi değeri döndüren soyut bir hesaplama motoru tanıtır. Varolan bir Excel dosyasını yükleyerek veya yeni bir Excel dosyası oluşturarak, Aspose.Cells tarafından sağlanan yöntemleri kullanarak bir dizi değeri alabiliriz ve sonucu döndürebiliriz. Son olarak, değiştirilmiş Excel dosyasını diske kaydederiz.
Döngüsel Referansın Algılanması