Worksheet id changed after save excel on desktop

Vipin Bhandari 0 Reputation points
2024-01-30T15:12:55.91+00:00

Problem Statement : We are working on Microsoft add-in AM365. In this Add-in we have consolidated data of all the sheets and user can manipulate the data (update , delete , insert) in grid format. When we save the data in excel we store worksheetId at our end for every sheet so when we reopen the excel again we can create a connection between the AM365 and worksheets. After reopening the workbook user can continue the data manipulation using AM-365. But after saving the workbook the worksheetId gets changed and user is no longer able to continue working on same excel using AM-365.

Steps :

  1. Open Excel desktop
  2. enter some data into cells
  3. Click on automate and click on new script and run script on right panel
   function main(workbook: ExcelScript.Workbook) {
   
       const y = workbook.getWorksheets().forEach(a => { console.log(a.getId()) })
   
   }
   
  1. check the worksheet id
  2. Now save the excel as .xlsx and close excel and reopen the same file again.
  3. repeat step 3 again.

match the before save and after save worksheet id.

Actual : Both worksheet ID before save and after save are different.

Expected : Both ID should be the same before save or after save.

Excel
Excel
A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
2,176 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.
4,366 questions
{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.