import sys
import io
import ctypes
import json
import win32api
import datetime
import pandas as pd
wb = excel.Workbooks.Open('C:\\Users\\{{사용자계정}}\\Documents\\sample.xlsx')
ws = wb.Worksheets("Sheet1")
ws.Range('A1').PasteSpecial()
ws.Columns('A:Z').AutoFit()
wb.WorkSheets.Add()
ws2 = wb.ActiveSheet
ws2.Name = "Sheet2"
ws2.Range('A1').PasteSpecial()
ws2.Columns('A:Z').AutoFit()
ws2.Range('A:Z').FormatConditions.Add(Type=2, Operator=8, Formula1="=A1<>Sheet1!A1", Formula2=None)
ws2.Range('A:Z').FormatConditions(1).Interior.Color = 255
ws2.Range('A:Z').FormatConditions(1).Font.Color = 16777215
now_datetime = datetime.datetime.now().strftime("%Y%m%d_%H%M%S")
excel.ActiveWorkBook.SaveAs("C:\\Users\\{{사용자계정}}\\Documents\\{file_name}-{create_time}.xlsx".format(file_name="{{파일명}}",create_time=now_datetime))
excel.DisplayAlerts = False
wb.Close(False)
excel.Quit()
wb = None
ws = None
ws2 = None
excel_functions.close_excel_by_force(excel)