From 62ced4486b5b05ebc5296317f8b832792e022879 Mon Sep 17 00:00:00 2001 From: "Bobby Abellana (aider)" Date: Thu, 13 Feb 2025 14:25:30 -0800 Subject: [PATCH] refactor: Update chartsheet detection using isinstance() in copy_excel_file --- src/main.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 1d1fda9..1214fbe 100644 --- a/src/main.py +++ b/src/main.py @@ -73,7 +73,8 @@ def copy_excel_file(source_path, destination_path, passwords): source_sheet = source_wb[sheet_name] # Create new sheet in destination workbook - if source_sheet.sheet_type == 'chartsheet': + from openpyxl.chartsheet import Chartsheet + if isinstance(source_sheet, Chartsheet): # For chartsheets, we need to create a worksheet instead dest_sheet = dest_wb.create_sheet(title=sheet_name)