如何在关闭电脑时安排宏运行? [英] How do I schedule a macro to run while my pc is turned off?

查看:111
本文介绍了如何在关闭电脑时安排宏运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我有一个我写的宏刷新13个单独的文件。刷新的总时间是6小时,在此期间锁定我的Excel。理想情况下,我想安排宏在我的电脑关闭后运行几个小时,以便在工作时间释放我的Excel。

任何帮助将不胜感激。

谢谢你,

Hello,
I have a macro I wrote which refreshes 13 separate files. The total time of refresh is 6 hours which locks my excel during this time. Ideally, I'd like to schedule the macro to run after hours when my pc is off in order to have free up my excel during business hours.
Any assistance would be greatly appreciated.
Thank you,

推荐答案

'off'的定义是你的电脑没有运行。所以,我认为这是一个笑话。



如果你的意思是我什么时候注销,那就写一个服务去做。
The definition of 'off' is that your computer is not running. So, I assume this is a joke.

If you mean 'when I am logged off', then write a service to do it.


使用在打开工作簿后运行的​​宏创建一个新工作簿:



Private Sub Workbook_Open()

'在这里插入你的代码'

End Sub



使用任务计划程序并创建一个在所需时间打开该工作簿的任务。 br />
- 在任务的条件选项卡下,将出现一个唤醒计算机以运行此任务复选框。确保选中。



执行此操作并且我相信只要PC处于休眠且未完全关闭状态,代码就可以正常工作。如果有效,请告诉我。

谢谢! :)



-Kyle
Create a new workbook with a macro that runs once the workbook is opened:

Private Sub Workbook_Open()
'insert your code here'
End Sub

use "Task Scheduler" and create a task that opens that workbook at the desired time.
- under the "conditions" tab of the task, there will be a check box "Wake the computer to run this task". Make sure that is checked.

Do this and I believe the code should work as long as the PC is sleeping and not fully powered down. Please let me know if this works or not.
Thanks! :)

-Kyle


这篇关于如何在关闭电脑时安排宏运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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