Excel Add-In read cell in another workbook

Shaun Pendrigh 20 Reputation points
2025-10-14T09:38:52.36+00:00

It does not seem to be possible to read the contents of another workbook using the Excel JavaScript API. It seems you only have access to the workbook where the Add-In is executing. Is that correct? I have read the section of the documentation “Work with workbooks using the Excel JavaScript API” which does not seem to show any way to do this. But I want to be 100% sure as this is going to be a critical requirement for my application. Thanks

Microsoft 365 and Office | Development | Office JavaScript API
0 comments No comments
{count} votes

Answer accepted by question author
  1. Gabriel-N 7,855 Reputation points Microsoft External Staff Moderator
    2025-10-14T12:03:57.9766667+00:00

    Dear Shaun Pendrigh

    Thank you for posting your question on the Q&A forum regarding reading cells from another workbook using the Excel JavaScript API.

    Based on my research, your interpretation appears to be accurate. According to Work with workbooks using the Excel JavaScript API: “The Workbook object is the entry point for your add-in to interact with Excel. It maintains collections of worksheets, tables, PivotTables, and more, through which Excel data is accessed and changed.” This means the Workbook object is the root for all operations and only contains data for the current workbook where the add-in is running.

    Additionally, in the Excel.Workbook class documentation, the first sentence states: “Workbook is the top level object which contains related workbook objects such as worksheets, tables, and ranges.” This reinforces that all Office.js operations are limited to the current workbook context.

    For further background, you can also review Privacy and security for Office Add-ins. This document explains the security architecture and sandbox environment for add-ins. Even when running on Excel desktop, your add-in code is web-based (HTML, CSS, JavaScript) and executes inside an iframe sandbox. Due to modern browser security standards and the Same-Origin Policy, JavaScript running in a sandboxed iframe cannot access the local file system. This is a fundamental security mechanism to prevent malicious web pages from reading user data.

    Therefore, when Microsoft states that add-ins run in a sandboxed iframe, they are implicitly confirming that these security rules apply, including the restriction on accessing local files or other open workbooks directly.

    In addition, you may check this helpful resource: Browsers and webview controls used by Office Add-ins, which provides more insight into how Office Add-ins use an embedded browser control.

    If you need to work with data from another workbook, you might consider alternatives such as:

    • Microsoft Graph Excel REST API for files stored in OneDrive or SharePoint.
    • Office Scripts + Power Automate to orchestrate data transfer between workbooks.
    • Linked workbook formulas (e.g., =[Other.xlsx]Sheet1!A1) for native Excel linking.

    Hope this information is helpful.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".     

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Shaun Pendrigh 20 Reputation points
    2025-10-15T05:00:11.42+00:00

    Thanks for the reply @Gabriel-N

    Do you happen to know if this will ever change? I understand the difference in the JavaScript technology, but it is extremely limiting to not be able to interact with other workbooks from an Add-In application. Obviously older Add-In technologies like VBA did not have this constraint.

    I will investigate using your suggestions as a potential workaround. But would much prefer to not need to complicate the technology framework of my application and simply reference a separate workbook instance.


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.