Skip to content
Sheetwrite

@sheetwrite/core/external-links

updateExternalLinksfunction

Report a problem

On this page

Fetch fresh values for linked workbooks and save them in one undoable change. It asks resolve for the current values of the links named in books (all links when omitted), then saves them and recalculates the formulas that read them, as Excel's "Update Values" does. Links whose resolver gives null or fails keep their saved values.

Declaration

function updateExternalLinks(
grid: Grid,
books?: readonly string[],
): Promise<ExternalLinkUpdate[]>

Parameters

grid: Gridrequired

The grid whose workbook holds the links.

resolve: ExternalLinkResolverrequired

Gives the current values of one linked workbook, or null when it is not available.

books?: readonly string[]optional

Names of the linked workbooks to update; all links when omitted. Case is ignored.

Returns

One result per link asked for, in link order.

Throws

SheetwriteError with code aborted when the grid is destroyed while resolve runs.