diff --git a/how-to/integration-excel/client/src/excel.ts b/how-to/integration-excel/client/src/excel.ts index 4e136d79..349defe0 100644 --- a/how-to/integration-excel/client/src/excel.ts +++ b/how-to/integration-excel/client/src/excel.ts @@ -255,7 +255,7 @@ async function populateWorksheets(): Promise { * @param name The name of worksheet to select. */ async function selectWorksheet(name: string): Promise { - if (openWorksheets && selectedWorksheetIndex === undefined) { + if (openWorksheets) { const newWorksheetIndex = openWorksheets.findIndex((w) => w.name === name); if (newWorksheetIndex !== selectedWorksheetIndex) {