Office JS Add-In Excel: NamedItem losts it's reference and returns =#REF!$[Location]

M.Doan 0 Reputation points
2023-08-15T07:34:33.9566667+00:00

My Set-up: MacOs, Excel Desktop

Problem: when loading a template file via insertWorksheetsFromBase64 to insert new workbook the formula (Formula > Name Manager) losts it's reference from the source workbook. Instead, it returns =#REF!$[Location] in the formula.

For example: in the template file, i named the B2 cell to qxInput (picture below). After copying the source workbook to the current workbook, the sheet reference was not found. If I then load another workbook, the namedItem is still visible.

Question:

  1. Is there any solution to load the workbook with the namedItem correctly without losing it's reference.
  2. The namedItem should only be accessible on that current workbook. After copying a new workbook in the current workbook, the old namedItem from old workbook should not be loaded/visible

It works fine on Excel Browser

Fotos:

  • Formula > Name Manager on template file: picture 1
  • Screenshot 2023-08-15 at 09.30.00
  • Formula > Name Manager on loaded sheet in current workbook: picture 2

Screenshot 2023-08-15 at 09.30.13

Excel
Excel
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
1,804 questions
JavaScript API
JavaScript API
An Office service that supports add-ins to interact with objects in Office client applications.
967 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,826 questions
Office Mac
Office Mac
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Mac: A family of Apple personal computers that run the macOS operating system.
492 questions
0 comments No comments
{count} votes

Your answer

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