This commit is contained in:
2024-09-14 11:21:47 +03:30
parent 71848c9f72
commit ff2af84c4d
3 changed files with 17 additions and 4 deletions

View File

@@ -80,9 +80,19 @@ console.print(f"Selected: {pathlib.Path(ref_workbook_name).stem}")
# workbook = load_workbook(ref_workbook_name)
temp_workbook = str(pathlib.Path.cwd() / "temp_workbook.xlsx")
shutil.copyfile(ref_workbook_name, temp_workbook)
# in case of this error
# AttributeError: module 'win32com.gen_py.00020813-0000-0000-C000-000000000046x0x1x9' has no attribute 'CLSIDToClassMap'
# see https://stackoverflow.com/questions/52889704
excel = win32.gencache.EnsureDispatch("Excel.Application")
excel.Visible = True
# Need to load the addins before opening the workbook
workbook = excel.Workbooks.Open(temp_workbook)
addin_path_1 = content[3]
excel.Workbooks.Open(addin_path_1)
addin_path_2 = content[4]
excel.Workbooks.Open(addin_path_2)
cells_to_clear = path_df[
(path_df["set_name"] == selected_set) & (path_df["dir"].str.endswith(selected_dir))
]["cells_to_clear"].iloc[0]

View File

@@ -1,12 +1,13 @@
dir,pattern,set_name,cells_to_clear,serial_cell
"D:\Kimia Razi\Production\QC Datasheet\1403\KRCY1100T Blue","KRCY1100T Blue [SERIAL].xlsx","Kimia Razi","Batch!C14,Batch!C18:C19,Batch!B20,Batch!C3,Batch!G11,Batch!G14,Batch!G18,Batch!I11,Batch!I14,Batch!I18,Batch!K11:M11,Batch!K14:M14,Batch!K18:M18,Batch!B20,Milling!F8:J8,Milling!F11:J12,Milling!F15:J15,Milling!C15,Milling!C12,Milling!C11,'KW & Temp'!A8:G8,'KW & Temp'!I8","Batch!C2"
"D:\Kimia Razi\Production\QC Datasheet\1403\KRCY1100T Blue","KRCY1100T Blue [SERIAL].xlsx","Kimia Razi","Batch!F2:F3,Batch!I2:I3,Batch!H12:L12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D24,'KW & Temp'!C4:H4,'KW & Temp'!J4,Milling!G5:K8,Milling!G11:K11,Milling!D7:D8,Milling!D11","Batch!D3"
"D:\Kimia Razi\Production\QC Datasheet\1403\KRBK1300T Black","KRBK1300T Black [SERIAL].xlsx","Kimia Razi","Batch!C14,Batch!C18:C19,Batch!B20,Batch!C3,Batch!G11,Batch!G14,Batch!G18,Batch!I11,Batch!I14,Batch!I18,Batch!K11:M11,Batch!K14:M14,Batch!K18:M18,Batch!B20,Milling!F8:J8,Milling!F11:J12,Milling!F15:J15,Milling!C15,Milling!C12,Milling!C11,'KW & Temp'!A8:G8,'KW & Temp'!I8","Batch!C2"
"D:\Kimia Razi\Production\QC Datasheet\1403\KRBR1200T Brown","KRBR1200T Brown [SERIAL].xlsx","Kimia Razi","Batch!C14,Batch!C18:C19,Batch!B20,Batch!C3,Batch!G11,Batch!G14,Batch!G18,Batch!I11,Batch!I14,Batch!I18,Batch!K11:M11,Batch!K14:M14,Batch!K18:M18,Batch!B20,Milling!F8:J8,Milling!F11:J12,Milling!F15:J15,Milling!C15,Milling!C12,Milling!C11,'KW & Temp'!A8:G8,'KW & Temp'!I8","Batch!C2"
"D:\Kimia Razi\Production\QC Datasheet\1403\KRYL1400T Yellow","KRYL1400T Yellow [SERIAL].xlsx","Kimia Razi","Batch!G14,Batch!G11,Batch!I11,Batch!I14,Batch!I20,Batch!G20,Batch!K11:M11,Batch!K14:M14,Batch!K20:M20,Batch!C14,Batch!C20:C21,Batch!C3,Batch!B22,'KW & Temp'!A8:G8,'KW & Temp'!I8,Milling!F8:J8,Milling!F10:J11,Milling!F14:J14,Milling!C14,Milling!C11","Batch!C2"
"D:\Kimia Razi\Production\QC Datasheet\1403\KRBG1600T Beige","KRBG1600T Beige [SERIAL].xlsx","Kimia Razi","Batch!G12,Batch!G15,Batch!G21,Batch!I12,Batch!I15,Batch!I21,Batch!K12:M12,Batch!K15:M15,Batch!K21:M21,Batch!B23,Batch!C21:C22,Batch!C15,Batch!C3,Batch!B23,'KW & Temp'!A8:G8,'KW & Temp'!I8,Milling!F8:J8,Milling!F10:J11,Milling!F14:J14,Milling!C14,Milling!C11","Batch!C2"
"D:\Kimia Razi\Production\QC Datasheet\1403\KRPK1500T Pink","KRPK1500T Pink [SERIAL].xlsx","Kimia Razi","Batch!G14,Batch!G11,Batch!I11,Batch!I14,Batch!I20,Batch!G20,Batch!K11:M11,Batch!K14:M14,Batch!K20:M20,Batch!C14,Batch!C20:C21,Batch!C3,Batch!B22,'KW & Temp'!A8:G8,'KW & Temp'!I8,Milling!F8:J8,Milling!F10:J11,Milling!F14:J14,Milling!C14,Milling!C11","Batch!C2"
"D:\Kimia Razi\Production\QC Datasheet\1403\KRHN1700T Honey","KRHN1700T Honey [SERIAL].xlsx","Kimia Razi","Batch!F2:F3,Batch!I2:I3,Batch!H12:L12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D24,'KW & Temp'!C4:H4,'KW & Temp'!J4,Milling!G5:K8,Milling!G11:K11,Milling!D7:D8,Milling!D11","Batch!D3"
"D:\inco\Quality control data sheet\2024\ICJEH680 Black","ICJ_EH680 op. [SERIAL].xlsx","inco","Batch!C15:C16,Batch!C18,Batch!C20:C21,Batch!C3,Batch!C12,Batch!H9,Batch!H12,Batch!H20,Batch!J9:K9,Batch!J12:K12,Batch!J20:K20,Batch!B22,Batch!M7:N22,'KW & Temp'!A8:G8,'KW & Temp'!I8,Milling!D8,Milling!C9:C11,Milling!C15,Milling!F8:J11,Milling!F15:J15","Batch!C2"
"D:\inco\Quality control data sheet\2024\ICJ108 Beige","ICJ_108 op. [SERIAL].xlsx","inco","Batch!C15:C18,Batch!C20:C21,Batch!C3,Batch!C12,Batch!H9,Batch!H12,Batch!H20,Batch!J9:K9,Batch!J12:K12,Batch!J20:K20,Batch!B22,Batch!M7:N22,Milling!D8,'KW & Temp'!A8:G8,'KW & Temp'!I8,Milling!C9:C11,Milling!C15,Milling!F8:J11,Milling!F15:J15","Batch!C2"
"D:\inco\Quality control data sheet\2024\ICJ610 Black","ICJ_610 op. [SERIAL].xlsx","inco","Batch!C15:C18,Batch!C20:C21,Batch!C3,Batch!C12,Batch!H9,Batch!H12,Batch!H20,Batch!J9:K9,Batch!J12:K12,Batch!J20:K20,Batch!B22,Batch!M7:N22,Milling!D8,'KW & Temp'!A8:G8,'KW & Temp'!I8,Milling!C9:C11,Milling!C15,Milling!F8:J11,Milling!F15:J15","Batch!C2"
"D:\inco\Quality control data sheet\2024\ICJ407 Brown","ICJ_407 op. [SERIAL].xlsx","inco","Batch!C15:C18,Batch!C20:C21,Batch!C3,Batch!C12,Batch!H9,Batch!H12,Batch!H20,Batch!J9:K9,Batch!J12:K12,Batch!J20:K20,Batch!B22,Batch!M7:N22,Milling!D8,'KW & Temp'!A8:G8,'KW & Temp'!I8,Milling!C9:C11,Milling!C15,Milling!F8:J11,Milling!F15:J15","Batch!C2"
"D:\inco\Quality control data sheet\2024\ICJ610 Black","ICJ_610 op. [SERIAL].xlsx","inco","Batch!F2:F3,Batch!I2:I3,Batch!E12:L12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D24,'KW & Temp'!C4:H4,'KW & Temp'!J4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11","Batch!D3"
"D:\inco\Quality control data sheet\2024\ICJ407 Brown","ICJ_407 op. [SERIAL].xlsx","inco","Batch!F2:F3,Batch!I2:I3,Batch!E12:L12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D24,'KW & Temp'!C4:H4,'KW & Temp'!J4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11","Batch!D3"
"D:\inco\Quality control data sheet\2024\ICJ703 Pink","ICJ_703 op. [SERIAL].xlsx","inco","Batch!C15:C18,Batch!C20:C21,Batch!C3,Batch!C12,Batch!H9,Batch!H12,Batch!H20,Batch!J9:K9,Batch!J12:K12,Batch!J20:K20,Batch!B22,Batch!M7:N22,Milling!D8,'KW & Temp'!A8:G8,'KW & Temp'!I8,Milling!C9:C11,Milling!C15,Milling!F8:J11,Milling!F15:J15","Batch!C2"
1 dir pattern set_name cells_to_clear serial_cell
2 D:\Kimia Razi\Production\QC Datasheet\1403\KRCY1100T Blue KRCY1100T Blue [SERIAL].xlsx Kimia Razi Batch!C14,Batch!C18:C19,Batch!B20,Batch!C3,Batch!G11,Batch!G14,Batch!G18,Batch!I11,Batch!I14,Batch!I18,Batch!K11:M11,Batch!K14:M14,Batch!K18:M18,Batch!B20,Milling!F8:J8,Milling!F11:J12,Milling!F15:J15,Milling!C15,Milling!C12,Milling!C11,'KW & Temp'!A8:G8,'KW & Temp'!I8 Batch!F2:F3,Batch!I2:I3,Batch!H12:L12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D24,'KW & Temp'!C4:H4,'KW & Temp'!J4,Milling!G5:K8,Milling!G11:K11,Milling!D7:D8,Milling!D11 Batch!C2 Batch!D3
3 D:\Kimia Razi\Production\QC Datasheet\1403\KRBK1300T Black KRBK1300T Black [SERIAL].xlsx Kimia Razi Batch!C14,Batch!C18:C19,Batch!B20,Batch!C3,Batch!G11,Batch!G14,Batch!G18,Batch!I11,Batch!I14,Batch!I18,Batch!K11:M11,Batch!K14:M14,Batch!K18:M18,Batch!B20,Milling!F8:J8,Milling!F11:J12,Milling!F15:J15,Milling!C15,Milling!C12,Milling!C11,'KW & Temp'!A8:G8,'KW & Temp'!I8 Batch!C2
4 D:\Kimia Razi\Production\QC Datasheet\1403\KRBR1200T Brown KRBR1200T Brown [SERIAL].xlsx Kimia Razi Batch!C14,Batch!C18:C19,Batch!B20,Batch!C3,Batch!G11,Batch!G14,Batch!G18,Batch!I11,Batch!I14,Batch!I18,Batch!K11:M11,Batch!K14:M14,Batch!K18:M18,Batch!B20,Milling!F8:J8,Milling!F11:J12,Milling!F15:J15,Milling!C15,Milling!C12,Milling!C11,'KW & Temp'!A8:G8,'KW & Temp'!I8 Batch!C2
5 D:\Kimia Razi\Production\QC Datasheet\1403\KRYL1400T Yellow KRYL1400T Yellow [SERIAL].xlsx Kimia Razi Batch!G14,Batch!G11,Batch!I11,Batch!I14,Batch!I20,Batch!G20,Batch!K11:M11,Batch!K14:M14,Batch!K20:M20,Batch!C14,Batch!C20:C21,Batch!C3,Batch!B22,'KW & Temp'!A8:G8,'KW & Temp'!I8,Milling!F8:J8,Milling!F10:J11,Milling!F14:J14,Milling!C14,Milling!C11 Batch!C2
6 D:\Kimia Razi\Production\QC Datasheet\1403\KRBG1600T Beige KRBG1600T Beige [SERIAL].xlsx Kimia Razi Batch!G12,Batch!G15,Batch!G21,Batch!I12,Batch!I15,Batch!I21,Batch!K12:M12,Batch!K15:M15,Batch!K21:M21,Batch!B23,Batch!C21:C22,Batch!C15,Batch!C3,Batch!B23,'KW & Temp'!A8:G8,'KW & Temp'!I8,Milling!F8:J8,Milling!F10:J11,Milling!F14:J14,Milling!C14,Milling!C11 Batch!C2
7 D:\Kimia Razi\Production\QC Datasheet\1403\KRPK1500T Pink KRPK1500T Pink [SERIAL].xlsx Kimia Razi Batch!G14,Batch!G11,Batch!I11,Batch!I14,Batch!I20,Batch!G20,Batch!K11:M11,Batch!K14:M14,Batch!K20:M20,Batch!C14,Batch!C20:C21,Batch!C3,Batch!B22,'KW & Temp'!A8:G8,'KW & Temp'!I8,Milling!F8:J8,Milling!F10:J11,Milling!F14:J14,Milling!C14,Milling!C11 Batch!C2
8 D:\Kimia Razi\Production\QC Datasheet\1403\KRHN1700T Honey KRHN1700T Honey [SERIAL].xlsx Kimia Razi Batch!F2:F3,Batch!I2:I3,Batch!H12:L12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D24,'KW & Temp'!C4:H4,'KW & Temp'!J4,Milling!G5:K8,Milling!G11:K11,Milling!D7:D8,Milling!D11 Batch!D3
9 D:\inco\Quality control data sheet\2024\ICJEH680 Black ICJ_EH680 op. [SERIAL].xlsx inco Batch!C15:C16,Batch!C18,Batch!C20:C21,Batch!C3,Batch!C12,Batch!H9,Batch!H12,Batch!H20,Batch!J9:K9,Batch!J12:K12,Batch!J20:K20,Batch!B22,Batch!M7:N22,'KW & Temp'!A8:G8,'KW & Temp'!I8,Milling!D8,Milling!C9:C11,Milling!C15,Milling!F8:J11,Milling!F15:J15 Batch!C2
10 D:\inco\Quality control data sheet\2024\ICJ108 Beige ICJ_108 op. [SERIAL].xlsx inco Batch!C15:C18,Batch!C20:C21,Batch!C3,Batch!C12,Batch!H9,Batch!H12,Batch!H20,Batch!J9:K9,Batch!J12:K12,Batch!J20:K20,Batch!B22,Batch!M7:N22,Milling!D8,'KW & Temp'!A8:G8,'KW & Temp'!I8,Milling!C9:C11,Milling!C15,Milling!F8:J11,Milling!F15:J15 Batch!C2
11 D:\inco\Quality control data sheet\2024\ICJ610 Black ICJ_610 op. [SERIAL].xlsx inco Batch!C15:C18,Batch!C20:C21,Batch!C3,Batch!C12,Batch!H9,Batch!H12,Batch!H20,Batch!J9:K9,Batch!J12:K12,Batch!J20:K20,Batch!B22,Batch!M7:N22,Milling!D8,'KW & Temp'!A8:G8,'KW & Temp'!I8,Milling!C9:C11,Milling!C15,Milling!F8:J11,Milling!F15:J15 Batch!F2:F3,Batch!I2:I3,Batch!E12:L12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D24,'KW & Temp'!C4:H4,'KW & Temp'!J4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11 Batch!C2 Batch!D3
12 D:\inco\Quality control data sheet\2024\ICJ407 Brown ICJ_407 op. [SERIAL].xlsx inco Batch!C15:C18,Batch!C20:C21,Batch!C3,Batch!C12,Batch!H9,Batch!H12,Batch!H20,Batch!J9:K9,Batch!J12:K12,Batch!J20:K20,Batch!B22,Batch!M7:N22,Milling!D8,'KW & Temp'!A8:G8,'KW & Temp'!I8,Milling!C9:C11,Milling!C15,Milling!F8:J11,Milling!F15:J15 Batch!F2:F3,Batch!I2:I3,Batch!E12:L12,Batch!O9:Q10,Batch!O12:Q12,Batch!N10,Batch!N13,Batch!D24,'KW & Temp'!C4:H4,'KW & Temp'!J4,Milling!G5:K8,Milling!G11:K11,Milling!D6:D8,Milling!D11 Batch!C2 Batch!D3
13 D:\inco\Quality control data sheet\2024\ICJ703 Pink ICJ_703 op. [SERIAL].xlsx inco Batch!C15:C18,Batch!C20:C21,Batch!C3,Batch!C12,Batch!H9,Batch!H12,Batch!H20,Batch!J9:K9,Batch!J12:K12,Batch!J20:K20,Batch!B22,Batch!M7:N22,Milling!D8,'KW & Temp'!A8:G8,'KW & Temp'!I8,Milling!C9:C11,Milling!C15,Milling!F8:J11,Milling!F15:J15 Batch!C2

View File

@@ -1,3 +1,5 @@
Select Set
Select Ink Color
Serial:
Serial:
C:\Users\johar\AppData\Roaming\Microsoft\AddIns\Diaco.KimiaRazi.Inkunit.xlam
C:\Users\johar\AppData\Roaming\Microsoft\AddIns\Persian Function For EXCEL_V2_1(www.rasekhoon.net).xla