Excel JS display file paths of linked workbooks

Oliver Muthusami (FYB) 5 Reputation points
2023-08-02T02:25:24.3633333+00:00

Is it possible to retrieve file paths of linked Excel workbooks using the Office JS API (Excel js)?

I can see a LinkedWorkbook property, however, the isNull value returns true and the getItems function returns undefined., so I can't iterate over the linked workbooks.

As you can see, I do have a linked workbook in the Excel sheet that I am currently working on:
User's image

await Excel.run(async (context) => { 
	context.workbook.load("linkedWorkbooks");
	await context.sync();
	const isNull = context.workbook.linkedWorkbooks.isNullObject;
	const items = context.workbook.linkedWorkbooks.items;
});
Microsoft 365 and Office | Development | Other
{count} vote

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.