您可以使用ProgID来确定这一点:
import win32com.client
try:
excel = win32com.client.Dispatch("Excel.Application")
version = excel.version
print("Excel version:", version)
except:
print("There are no excel installed")
我的电脑上安装了Office 365,我得到了以下输出:
Excel version: 16.0
我还建议你读this篇文章.