python调用excel的宏_配置Office Excel运行Python宏脚本

基本环境

名称

版本

操作系统

Windows 10 x64

Office

2016

安装Python

1.下载Python安装包

登录https://www.python.org/downloads/windows/进行下载

Python2.x或Python3.x均可,推荐Python3.x(因为2020年1月1日起Python2就停止服务了...)

python调用excel的宏_配置Office Excel运行Python宏脚本_第1张图片

2.安装Python

安装前,勾选Add Python 3.x to PATH选项。安装完毕之后,在Windows控制台可直接使用python命令。

python调用excel的宏_配置Office Excel运行Python宏脚本_第2张图片

3.检查是否安装成功

按Win+R,打开运行,输入PowerShell,打开命令行。

输入python -V,查看Python版本号。

python调用excel的宏_配置Office Excel运行Python宏脚本_第3张图片

4.安装PythonWin32库

Python2.x 按以下方式安装

pip install pypiwin32 -i https://mirrors.aliyun.com/pypi/simple/

Python3.x 按以下方式安装

pip install pywin32 -i https://mirrors.aliyun.com/pypi/simple/

安装ExcelPython

或点击此处直接下载

python调用excel的宏_配置Office Excel运行Python宏脚本_第4张图片

你可能感兴趣的:(python调用excel的宏)