openpyxl icon indicating copy to clipboard operation
openpyxl copied to clipboard

Workbook with CellRichText exception

Open alxpolyakov opened this issue 3 months ago • 0 comments

With code `blk = TextBlock font_bold = InlineFont(b=True) font_normal = InlineFont(b=False) wb = Workbook() ws = wb.active for r in data['requests']: rich_string = CellRichText( blk(font_normal, text='Заявка №'), blk(font_bold, text=str(r['id'])), blk(font_normal, text=' Мастерская'), blk(font_bold, text=str(r['shop']['sort'])), blk(font_normal, r['shop']['name']) ) ws['A%s' % (n,)] = rich_string n += 3

wb.save(tmp_file.name) ` I get an exception AttributeError 'TextBlock' object has no attribute 'name'

alxpolyakov avatar Apr 02 '24 04:04 alxpolyakov