fix: Improve chartsheet warning to show original filename
This commit is contained in:
parent
f9b982dd02
commit
5031f9a0e6
@ -75,7 +75,10 @@ def copy_excel_file(source_path, destination_path, passwords):
|
|||||||
# Create new sheet in destination workbook
|
# Create new sheet in destination workbook
|
||||||
from openpyxl.chartsheet import Chartsheet
|
from openpyxl.chartsheet import Chartsheet
|
||||||
if isinstance(source_sheet, Chartsheet):
|
if isinstance(source_sheet, Chartsheet):
|
||||||
chartsheet_warning = f"Chartsheet detected in '{os.path.basename(source_path)}' on sheet '{sheet_name}'."
|
original_filename = os.path.basename(source_path)
|
||||||
|
if '_processed' in original_filename: # If it's a temp file, get original name
|
||||||
|
original_filename = original_filename.split('_processed')[0]
|
||||||
|
chartsheet_warning = f"Chartsheet detected in '{original_filename}' on sheet '{sheet_name}'."
|
||||||
# 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