Set External Links in Formulas

Contents
[ ]

The sample code below shows how to include external files in formulas.

from aspose.cells import Workbook
# For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET
# The path to the documents directory.
dataDir = RunExamples.GetDataDir(".")
# Instantiate a new Workbook.
workbook = Workbook()
# Get first Worksheet
sheet = workbook.worksheets[0]
# Get Cells collection
cells = sheet.cells
# Set formula with external links
cells.get("A1").formula = "=SUM('[" + dataDir + "book1.xlsx]Sheet1'!A2, '[" + dataDir + "book1.xlsx]Sheet1'!A4)"
# Set formula with external links
cells.get("A2").formula = "='[" + dataDir + "book1.xlsx]Sheet1'!A8"
# Save the workbook
workbook.save(dataDir + "output_out.xlsx")