xlwings是否支持“Wrap Text”属性?

问题描述 投票:1回答:2

我可以使用Python + xlwings控制单元格的“自动换行”属性吗?

python excel python-2.7 xlwings
2个回答
2
投票

它目前尚未实现,但我已经打开了一个功能请求here。在此期间,您始终可以通过访问Windows上的基础COM对象来解决:Mac上的Range('A1').xl_range.WrapText = True或appscript对象:Range('A1').xl_range.wrap_text.set(True)


-1
投票

对于最新的xlwings版本:

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
© www.soinside.com 2019 - 2024. All rights reserved.