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

Excel: TableChanged's details property is undefined when paste multiple cells #5308

Open
hamzamaimi opened this issue Jan 24, 2025 · 1 comment
Assignees
Labels
Area: Excel Issue related to Excel add-ins Needs: attention 👋 Waiting on Microsoft to provide feedback

Comments

@hamzamaimi
Copy link

TableChanged's details property is undefined when paste multiple cells

  • Platform : PC Desktop
  • Host : Excel
  • Office version number: Version 2412
  • Operating System: Windows 11

Expected behavior

When you copy two or more cells and then paste them inside a table it has to trigger the TableChangedEvent with the 'details' property that has to contain the previous values and the current values of the cells.

Current behavior

When you copy a single cell and paste it inside a table it does trigger a TableChangedEvent that contains the property 'details' that has the valueBefore and the valueAfter of the cell.
When you try to copy more than a single cell and paste it inside a table it does trigger the TableChangedEvent but the property 'details' it's always undefined.

Steps to reproduce

  1. Open Script Lab on Excel
  2. Go to samples and select (Data changed event)
  3. In the code replace the function registerDataChangedHandler with this
async function registerDataChangedHandler() {
  await Excel.run(async (context) => {
    const sheet = context.workbook.worksheets.getItem("Sample");
    const salesTable = sheet.tables.getItem("SalesTable");
    const salesByQuarterBinding = context.workbook.bindings.add(salesTable.getRange(), "Table", "SalesByQuarter");
    salesByQuarterBinding.onDataChanged.add(onSalesDataChanged);

    salesTable.onChanged.add(async (excelEvent) => {
      console.log("excelEvent with data->", excelEvent);
    });

    await context.sync();
  });
}
  1. write 2 random values in 2 cell's outside of the table's context
  2. copy the new 2 cells and paste them in 2 random cells inside the table context. This is going to trigger the event that is going to be printed in the console. You can notice the property details is undefined.
Recording.2025-01-24.153849.mp4
@microsoft-github-policy-service microsoft-github-policy-service bot added the Area: Excel Issue related to Excel add-ins label Jan 24, 2025
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: attention 👋 Waiting on Microsoft to provide feedback label Jan 24, 2025
Copy link
Contributor

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

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