diff --git a/how-to/integration-excel/client/src/excel.ts b/how-to/integration-excel/client/src/excel.ts index e6815c7b..aa41bbdf 100644 --- a/how-to/integration-excel/client/src/excel.ts +++ b/how-to/integration-excel/client/src/excel.ts @@ -255,13 +255,15 @@ async function populateWorksheets(): Promise { * @param name The name of worksheet to select. */ async function selectWorksheet(name: string): Promise { - if (openWorksheets && selectedWorksheetIndex !== undefined) { + if (openWorksheets && selectedWorksheetIndex === undefined) { const newWorksheetIndex = openWorksheets.findIndex((w) => w.name === name); if (newWorksheetIndex !== selectedWorksheetIndex) { - const oldWorksheet = openWorksheets[selectedWorksheetIndex]; - if (oldWorksheet) { - await oldWorksheet.sheet.removeEventListener(handleCellChange); + if(selectedWorksheetIndex !== undefined) { + const oldWorksheet = openWorksheets[selectedWorksheetIndex]; + if (oldWorksheet) { + await oldWorksheet.sheet.removeEventListener(handleCellChange); + } } selectedWorksheetIndex = newWorksheetIndex; diff --git a/how-to/integration-excel/public/manifest.fin.json b/how-to/integration-excel/public/manifest.fin.json index c40d3322..822242f9 100644 --- a/how-to/integration-excel/public/manifest.fin.json +++ b/how-to/integration-excel/public/manifest.fin.json @@ -22,8 +22,8 @@ "snapshot": { "windows": [ { - "defaultWidth": 600, - "defaultHeight": 600, + "defaultWidth": 800, + "defaultHeight": 900, "defaultLeft": 0, "defaultTop": 0, "saveWindowState": false,