Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

context.sync() Silently Errors After context.workbook.names.load("items") Inside A Named Item Binding #5217

Open
nickamckenna opened this issue Dec 22, 2024 · 3 comments
Assignees
Labels
Area: Excel Issue related to Excel add-ins Needs: attention 👋 Waiting on Microsoft to provide feedback

Comments

@nickamckenna
Copy link

Provide required information needed to triage your issue

Sample Project: demo.zip

For the web version of Excel, if you create a binding using:

context.workbook.bindings.addFromNamedItem(...)

and then in the callback try to do this:

evt.binding.context.workbook.names.load("items");
await evt.binding.context.sync();

officejs silently fails. It does not throw an Exception or return an error. Nothing appears in the console log.

The same problem happens if I try:

const ni2 = evt.binding.context.workbook.names.getItem(newName);

Your Environment

  • Platform [PC desktop, Mac, iOS, Office on the web]: Office on the Web
  • Host [Excel, Word, PowerPoint, etc.]: Excel
  • Office version number: Build 16.0.18417.42305
  • Operating System: Windows 11
  • Browser (if using Office on the web): Chrome, Edge

Expected behavior

I should be able to retrieve NamedItem objects inside a binding creating against a NamedItem.

Current behavior

OfficeJs fails silently with no error thrown and no information provided.

Steps to reproduce

  1. Use the attached sample project demo.zip
  2. npm run dev-server
  3. Install the Add-In manifest.xml in Excel for the Web
  4. Open the Taskpane
  5. Type "test1" in a cell in Column C
  6. Select the cell you have just typed in
  7. Click "Add A Binding To Current Cell" in the TaskPane
  8. Insert a column in Excel before Column C (to trigger the callback)
  9. Notice that the console.log contains messages "a" and "b", but not "c" or "d" and no error is reported

Link to live example(s)

  1. Project attached to this bug report demo.zip

Provide additional details

  1. As detailed above

Context

Our Excel Add-In tracks changes to cells. We need to be able to access the NamedItem inside the handler to manage bindings and perform other operations.

Useful logs

demo.zip

@microsoft-github-policy-service microsoft-github-policy-service bot added the Area: Excel Issue related to Excel add-ins label Dec 22, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: attention 👋 Waiting on Microsoft to provide feedback label Dec 22, 2024
Copy link
Contributor

Thank you for letting us know about this issue. We will take a look shortly. Thanks.

@nickamckenna
Copy link
Author

nickamckenna commented Dec 22, 2024

A bit more information. I get the same problem if I try:

const range = evt.binding.getRange();
await evt.binding.context.sync();

@RuizhiSunMS
Copy link

Mark it as #9643607 into our backlog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Excel Issue related to Excel add-ins Needs: attention 👋 Waiting on Microsoft to provide feedback
Projects
None yet
Development

No branches or pull requests

2 participants