OfficeDev / office-js

A repo and NPM package for Office.js, corresponding to a copy of what gets published to the official "evergreen" Office.js CDN, at https://appsforoffice.microsoft.com/lib/1/hosted/office.js.
https://learn.microsoft.com/javascript/api/overview
Other
688 stars 95 forks source link

Excel - VBA Worksheet_Change events not triggered by Add-In changes #2121

Closed ndreisg closed 7 months ago

ndreisg commented 3 years ago

Message from office-js bot: We’re closing this issue because it has been inactive for a long time. We’re doing this to keep the issues list manageable and useful for everyone. If this issue is still relevant for you, please create a new issue. Thank you for your understanding and continued feedback.

Worksheet_Change events stopped working

Your Environment

Expected behavior

Worksheet_Change events should be triggered by Add-In changes.

Current behavior

Changes made by an office-js Add-In are not triggering the VBA Worksheet_Change event anymore. This was working until recently and stopped working when I installed the latest Office updates.

Steps to reproduce

  1. Use any Add-In which inserts data into a worksheet
  2. Create a VBA macro with a simple alert on Worksheet_Change event
  3. Insert data with the Add-In -> Worksheet_Change event will not be triggered

Context

We have many customers which are using VBA Macros and are relying on the Worksheet_Change event to be triggered by Add-In changes. Customers already reported the issue to us.

qinliuMSFT commented 3 years ago

Hi @ndreisg , thanks for logging this issue. To better assist you, could you please share the APIs you called in JS Add-in to change worksheet content?

ndreisg commented 3 years ago

Sure. We are using Range.values API to change the worksheet content. Here is a sample gist made with Script Lab: https://gist.github.com/ndreisg/5d4f8499cd60d8c98ab3e353f63c9876 which can be used to reproduce the issue.

Oops accidentially closed 😅

qinliuMSFT commented 3 years ago

Thanks @ndreisg , the issue is reproducible from my side, it has been put on our backlog VSO#5441621, will let you know if we have any updates.

RuoyingLiang commented 3 years ago

@ndreisg We are doing a survey to understand the pain points of add-in’s developing experience. Would you mind to help fill this survey https://forms.office.com/Pages/ResponsePage.aspx?id=v4j5cvGGr0GRqy180BHbR5eAlIUFFQFHqE95qTMqQuVURVE4QkZPREoxOEk1TFEySDMyQTc0U0o0Ti4u ? It should take less than 5 minutes and will be supper helpful for us. Thank you!

ndreisg commented 7 months ago

@gergzk I think this should be closed as "fixed" At least in the latest MS365 version it's working as expected.

gergzk commented 7 months ago

@ndreisg - thanks for testing!