import openpyxl from openpyxl.utils import get_column_letter wb = openpyxl.load_workbook(r'C:\Users\shad0w\Documents\src\Peliagia_Portal\Prototype\Sample_PO.xlsx') ws = wb.active print('=== CELL STYLES (key cells) ===') key_cells = ['A1','A4','A5','C5','H5','A13','A15','B15','G15','A27','A37','A38','A39','G38','G39'] for coord in key_cells: cell = ws[coord] font = cell.font fill = cell.fill fill_color = None if fill and fill.fill_type and fill.fill_type != 'none': try: fill_color = fill.fgColor.rgb except: fill_color = 'unknown' color_rgb = None try: color_rgb = font.color.rgb except: pass print(f'{coord}: bold={font.bold}, size={font.size}, name={font.name}, color={color_rgb}, fill={fill_color}') print() print('=== BORDER CHECK (rows 4, 14, 15, 16, 26, 27) ===') for row_n in [4, 14, 15, 16, 26, 27]: for col_n in range(1, 10): coord = get_column_letter(col_n) + str(row_n) cell = ws[coord] b = cell.border sides = [] if b.top and b.top.border_style: sides.append('top=' + b.top.border_style) if b.bottom and b.bottom.border_style: sides.append('bot=' + b.bottom.border_style) if b.left and b.left.border_style: sides.append('lft=' + b.left.border_style) if b.right and b.right.border_style: sides.append('rgt=' + b.right.border_style) if sides: print(f' {coord}: {", ".join(sides)}')