Is there a way to set border lines for an Excel file from Python using xlwings? I was looking at the documentation but cannot figure out.
I want to create a file like this using xlwings
As far as I know, this isn't a feature that's built into xlwings at this point. However, you can use the lower level pywin32 functions (with caveats) as described in the xlwings docs here.
Here's a brief example of how to set borders on a single cell using this method:
rng = xw.Range('A1').xl_range
for border_id in xrange(7,13):
rng.Borders(border_id).LineStyle=1
rng.Borders(border_id).Weight=2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With