[英]How to edit text of ActiveX TextBox on Excel by Python using xlwings?
I'm trying to edit text of ActiveX TextBox on Excel by python using xlwing. 我正在尝试使用xlwing在python上通过Excel编辑ActiveX TextBox的文本。 How to edit it?
如何编辑?
I successed to edit text of normal TexBox like this. 我成功地像这样编辑普通TexBox的文本。
import xlwings as xw
wb = xw.Book('test.xlsx')
sheet = wb.sheets['Sheet1']
textbox = sheet.api.TextBoxes('TextBox1')
textbox .Text = 'test'
I tried some but I couldn't edit text of ActiveX TextBox. 我尝试了一些,但无法编辑ActiveX TextBox的文本。
test it 测试一下
sheet.api.OLEObjects("TextBox1").Object.Value = "some value"
Regards 问候
Josse 乔斯
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.