refactor: Update chartsheet detection using isinstance() in copy_excel_file

This commit is contained in:
Bobby Abellana (aider) 2025-02-13 14:25:30 -08:00
parent a850772b55
commit 62ced4486b

View File

@ -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)