使用 Python 更改 .XLSM 文件中的变量,运行宏并将其保存到另一个文件中

问题描述

我不确定如何开发功能代码。我正在使用在线找到的免费启用宏的软件,并尝试将其自动化。我找到了几个代码,但我仍然无法正常运行/python 无法读取代码

data_location=".xlsm" 
output_location=".xlsm"
ori_wb=openpyxl.load_workbook(data_location,keep_vba=True) 
ori_sh=ori_wb['Input'] 
ori_sh[range(E6)]='30'                            #Changing (e6) value to 30 for example 
run.ori_sh 
ori_wb.save(output_location) 
new_wb=openpyxl.load_workbook(output_location,data_only=True) 
new_sh=new_wb.get_sheet_by_name('Input') 
print(new_sh)

enter image description here

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)