//create a new workbook var workbook = new GrapeCity.Documents.Excel.Workbook(); workbook.Worksheets[0].Range["B1"].Formula = @"='D:\[A.xlsx]Sheet1'!A1"; // create a new workbook as the intance of external workbook. var workbook2 = new GrapeCity.Documents.Excel.Workbook(); workbook2.Worksheets[0].Range["A1"].Value = "Hello, World!"; // update the caches of external workbook data. foreach (var item in workbook.GetExcelLinkSources()) { workbook.UpdateExcelLink(item, workbook2); } // Save to an excel file workbook.Save("CrossWorkbookFormula.xlsx");
' Create a new Workbook Dim workbook As New Workbook workbook.Worksheets(0).Range!B1.Formula = "='D:\[A.xlsx]Sheet1'!A1" ' create a ne workbook as the intance of external workbook. Dim workbook2 As New Excel.Workbook workbook2.Worksheets(0).Range!A1.Value = "Hello, World!" ' update the caches of external workbook data. For Each item In workbook.GetExcelLinkSources() workbook.UpdateExcelLink(item, workbook2) Next ' save to an excel file workbook.Save("CrossWorkbookFormula.xlsx")