Julia using openpyxl to change column width & row height

For some reason putting the width setting inside py"""...""" works.

using PyCall
xl = pyimport("openpyxl")
wb = xl.Workbook()
ws = wb.active
# ws.column_dimensions["A"].width = 25  ## ERROR: KeyError: key "A" not found
py"""
$ws.column_dimensions["A"].width = 25
"""
wb.save("foo.xlsx")
1 Like