Formüllerde Dış Bağlantıları Ayarlama
Contents
[
Hide
]
Bazen, formülde dış dosyalara bağlantı eklemek gerekebilir, bu örneğin bir hücreyi veya aralığı değerine karşı değerlendirmek için. Aspose.Cells bu özelliği sağlar ve bu belgede bunun nasıl kullanılacağı açıklanmaktadır
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-Java | |
String dataDir = Utils.getDataDir(SetExternalLinksInFormulas.class); | |
// Instantiate a new Workbook. | |
Workbook workbook = new Workbook(); | |
// Get first Worksheet | |
Worksheet sheet = workbook.getWorksheets().get(0); | |
// Get Cells collection | |
Cells cells = sheet.getCells(); | |
// Set formula with external links | |
cells.get("A1").setFormula("=SUM('[F:\\book1.xls]Sheet1'!A2, '[F:\\book1.xls]Sheet1'!A4)"); | |
// Set formula with external links | |
cells.get("A2").setFormula("='[F:\\book1.xls]Sheet1'!A8"); | |
// Save the workbook | |
workbook.save(dataDir + "output.xls"); |