我正在尝试编写一个脚本来使用 Python 3.7 操作 Ubuntu Mint _LibreOffice Calc 表。出于某种原因,当我尝试导入 Uno 时出现错误。我可以从 Calc 内部运行一个宏调用这个
desktop = XSCRIPTCONTEXT.getDesktop()
model = desktop.getCurrentComponent()
active_sheet = model.CurrentController.ActiveSheet
write 'Hello World' in A1
active_sheet.getCellRangeByName("A1").String = "Hello World!
Run Code Online (Sandbox Code Playgroud)
”
但不能直接从 VS_code IDE 与工作表进行交互。是否有我需要设置为 Uno_ 的路径
使用 LibreOffice 6.4、Python 3.7 和 APSO。我对 LibreOffice 感到非常沮丧,似乎对新手的 Python 支持很少。