Formüllerde Dış Bağlantıları Ayarlama
Contents
[
Hide
]
Bazı durumlarda, formüllerde dış dosyalara bağlantı eklemek gerekebilir, örneğin, bir hücre veya aralık değerini bunlarla karşılaştırmak için. Aspose.Cells bu özelliği sağlar, bu belge, bunu nasıl kullanacağınızı açıklar.
Aşağıdaki örnek kod, formüllerde harici dosyaların nasıl dahil edileceğini gösterir.
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 | |
// The path to the documents directory. | |
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | |
// Instantiate a new Workbook. | |
Workbook workbook = new Workbook(); | |
// Get first Worksheet | |
Worksheet sheet = workbook.Worksheets[0]; | |
// Get Cells collection | |
Cells cells = sheet.Cells; | |
// Set formula with external links | |
cells["A1"].Formula = "=SUM('[" + dataDir + "book1.xlsx]Sheet1'!A2, '[" + dataDir + "book1.xlsx]Sheet1'!A4)"; | |
// Set formula with external links | |
cells["A2"].Formula = "='[" + dataDir + "book1.xlsx]Sheet1'!A8"; | |
// Save the workbook | |
workbook.Save(dataDir + "output_out.xlsx"); |