refactor: Update chartsheet detection using isinstance() in copy_excel_file
This commit is contained in:
parent
a850772b55
commit
62ced4486b
@ -73,7 +73,8 @@ def copy_excel_file(source_path, destination_path, passwords):
|
|||||||
source_sheet = source_wb[sheet_name]
|
source_sheet = source_wb[sheet_name]
|
||||||
|
|
||||||
# Create new sheet in destination workbook
|
# 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
|
# For chartsheets, we need to create a worksheet instead
|
||||||
dest_sheet = dest_wb.create_sheet(title=sheet_name)
|
dest_sheet = dest_wb.create_sheet(title=sheet_name)
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user