如何通过计划任务运行Excel宏 [英] How can you run an Excel macro through a schedule task

查看:654
本文介绍了如何通过计划任务运行Excel宏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要通过计划任务在Excel电子表格中运行宏。
我已经定义了如下工作:



C:\Program Files\Microsoft Office\Office10\EXCEL.EXE



问题是,当作业启动时,Excel会弹出一个弹出窗口,并询问是否要禁用/启用这些阻止执行作业的宏。 / p>

如何无需手动点击启用宏即可运行此宏?

解决方案

编写一个简短的vbscript,启动Excel,加载您的工作簿,并使用Application.Run运行宏。让你的计划任务运行vbscript。



例如: http: //www.mrexcel.com/forum/showthread.php?t=302970


I need to run a macro in an Excel spreadsheet through a schedule task. I've defined the job as below:

"C:\Program Files\Microsoft Office\Office10\EXCEL.EXE" ""

The problem is that when the job starts Excel displays a pop-up and asks if we want to disable/enable the macros, which blocks the execution of the job.

How can I run this macro without having to manually click on enable macro?

解决方案

Write a short vbscript which launches Excel, loads your workbook and uses Application.Run to run the macro. Have your scheduled task run the vbscript.

Eg: http://www.mrexcel.com/forum/showthread.php?t=302970

这篇关于如何通过计划任务运行Excel宏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆