Can I control the "Wrap Text" property of a cell using Python+xlwings?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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)
.
回答2:
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