我已经安装了 PythonWin。我可以从 Python 读取和写入 Excel,这不是问题。不是我需要的用法。我发现的所有示例都比我需要的复杂。因为,我正在远离 Excel,所以我需要半步进行测试。
什么是从 Excel 中触发 python 脚本的最简单方法。我不需要gui。用法:在打开 xls 时执行 python 脚本。没有什么花哨。
现在,我只是在打开 xls 之前手动执行脚本。
Private Sub Workbook_Open()
MyPythonScript.pyw ' this is where scripts should go. just one is all I need.
End Sub