我在UNO为LibreOffice创建Python宏时遇到困难
最终目标: 到我桌子的最后一排
实现的代码(到目前为止):
#!/bin/python3
#Script usado no programa Form_Atendimento.ods
#Cria objeto document, referenciando o documento aberto
document = XSCRIPTCONTEXT.getDocument()
#Cria objeto sheets, referenciando as planilhas
sheets = document.getSheets()
sheetForm = sheets.getByName('Form')
sheetBase = sheets.getByName('Base_de_Dados')
def testa_deslocamento(oEvent):
selectedsheet = sheetBase
cursor = selectedsheet.createCursor()
cursor.gotoEnd()
return 0
我知道代码是不完整的(对于我的最终目标),但我希望,至少光标会移动到列中的最后一个位置
结果(到目前为止): 显然没有。光标不会移动,也不会选择其他单元格进行处理
重要提示: 我需要处理相对位置,因为表可以有任何大小
请求: 您能告诉我如何将光标移到行或列的末尾(以及后面的一个单元格)吗
目前没有回答
相关问题 更多 >
编程相关推荐