# Julia using openpyxl to change column width & row height

**URL:** <https://discourse.julialang.org/t/julia-using-openpyxl-to-change-column-width-row-height/45172>\
**Category:** General Usage\
**Tags:** pycall\
**Created:** [August 18, 2020, 5:54pm UTC](https://discourse.julialang.org/t/julia-using-openpyxl-to-change-column-width-row-height/45172 "2020-08-18T17:54:08Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![jaakkor2](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jaakkor2/32/2540_2.png) [@jaakkor2](https://discourse.julialang.org/u/jaakkor2)\
**Post date:** [June 17, 2021, 6:14am UTC](https://discourse.julialang.org/t/julia-using-openpyxl-to-change-column-width-row-height/45172/6 "2021-06-17T06:14:30Z")

</div>

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

```julia
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")

```

---

_[View the full topic](https://discourse.julialang.org/t/julia-using-openpyxl-to-change-column-width-row-height/45172)._
