Worksheet id changed after save excel on desktop
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 :
- Open Excel desktop
- enter some data into cells
- 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()) })
}
- check the worksheet id
- Now save the excel as .xlsx and close excel and reopen the same file again.
- 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.