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 Table creation become slow when you have heavy Excel files opened (also in a separate window) #4988

Open
hamzamaimi opened this issue Oct 18, 2024 · 1 comment
Assignees
Labels
Area: Excel Issue related to Excel add-ins Status: in backlog Issue is being tracked in the backlog but timeline for resolution is unknown

Comments

@hamzamaimi
Copy link

hamzamaimi commented Oct 18, 2024

Your Environment

  • Platform [PC desktop]: PC desktop
  • Host : Excel
  • Office version number: (Version 2409 Build 16.0.18025.20030) 64 bit
  • Operating System: Windows 11 pro

Expected behaviour

I expect that the creation table time is it the same, regardless if a heavy Excel file is opened in another window.

Current behaviour

When you have heavy Excel files opened and you try to generate a table by using ScriptLab it take longer than when you have no heavy file opened. This is happen also when the heavy file is opened in a separate Excel window

Steps to reproduce

  • I open a 26mb or heavier xlsm file in an Excel window.
  • I open a new empty Excel window.
  • By using Script Lab I try to create a table with the "Add rows and columns" provided as a Sample.
  • I measure how long does it take by using the function console.time
  • I close the window of the 26mb file
  • I run again the script to create a table measuring how long does it take
  • What happen is that it takes way much longer to generate the table when I have a heavy a file opened (also if it is in another window)
    Screenshot 2024-10-18 124811
    (In the first log row I had no other file opened, in the second one I had the 26mb excel opened in a separate Excel window)

This is how I added my console.time function in the setup() function provided as a sample by Script Lab. It's called (Add rows and columns) :

/** Create a new table with sample data */
async function setup() {
  console.time('setupFunction');
  await Excel.run(async (context) => {
    context.workbook.worksheets.getItemOrNullObject("Sample").delete();
    const sheet = context.workbook.worksheets.add("Sample");

    const expensesTable = sheet.tables.add("A1:D1", true /*hasHeaders*/);
    expensesTable.name = "ExpensesTable";
    expensesTable.getHeaderRowRange().values = [["Date", "Merchant", "Category", "Amount"]];

    expensesTable.rows.add(null /*add at the end*/, [
      ["1/1/2017", "The Phone Company", "Communications", "$120"],
      ["1/2/2017", "Northwind Electric Cars", "Transportation", "$142"],
      ["1/5/2017", "Best For You Organics Company", "Groceries", "$27"],
      ["1/10/2017", "Coho Vineyard", "Restaurant", "$33"],
      ["1/11/2017", "Bellows College", "Education", "$350"],
      ["1/15/2017", "Trey Research", "Other", "$135"],
      ["1/15/2017", "Best For You Organics Company", "Groceries", "$97"]
    ]);

    sheet.getUsedRange().format.autofitColumns();
    sheet.getUsedRange().format.autofitRows();

    sheet.activate();
    await context.sync();
  });
  console.timeEnd('setupFunction');
}
@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: triage 🔍 New issue, needs PM on rotation to triage ASAP label Oct 18, 2024
@qinliuMSFT
Copy link
Member

@hamzamaimi , thank you for reporting this issue, I can repro it. It has been put on our backlog #9461419 , the team will investigate and we will reply to you as soon as there is any progress. Thank you for your patience.

@qinliuMSFT qinliuMSFT self-assigned this Oct 22, 2024
@qinliuMSFT qinliuMSFT added Area: Excel Issue related to Excel add-ins Status: in backlog Issue is being tracked in the backlog but timeline for resolution is unknown and removed Needs: triage 🔍 New issue, needs PM on rotation to triage ASAP labels Oct 22, 2024
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 Status: in backlog Issue is being tracked in the backlog but timeline for resolution is unknown
Projects
None yet
Development

No branches or pull requests

2 participants