Does xlwings support “Wrap Text” property?

2019-08-08 19:32发布

Can I control the "Wrap Text" property of a cell using Python+xlwings?

2条回答
放我归山
2楼-- · 2019-08-08 19:51

For the newest xlwings version:

import xlwings as xw
wb1 = xw.Book('Book1.xlsm').sheets['Sheet1']

wb1.range('A1').value="It's currently not implemented but I've opened a feature request here. In the meantime, you can always work around by accessing the underlying COM object on Windows: "
wb1.range('A1').WrapText = True
查看更多
做自己的国王
3楼-- · 2019-08-08 20:01

It's currently not implemented but I've opened a feature request here. In the meantime, you can always work around by accessing the underlying COM object on Windows: Range('A1').xl_range.WrapText = True or appscript object on Mac: Range('A1').xl_range.wrap_text.set(True).

查看更多
登录 后发表回答