如何在Windows XP中设置计划任务以在ms-access中运行宏?
我通常需要每天在到达办公室之前运行一个流程。我想将其设置为计划任务。
如何才能做到这一点?
这样做有最佳实践吗?
这可以或者应该以编程方式完成吗?
I typically have some need to run a process each day prior to my arrival at the office. I would like to set this up as a scheduled task.
How can this be accomplished?
Is there a best practice on doing this?
Can or should this be done programmatically?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
为了解决这个问题,我执行了以下操作:
创建了一个名为“Submit”的宏。
通过转到以下位置创建计划任务
.job
文件:开始>所有程序>配件>系统工具>计划任务
(这会在以下位置:“C:\WINDOWS\Tasks\Submit.job”)
创建后,我将以下语法放入
Run:
文本框中。此后,设置的剩余部分将按照正常计划任务的方式完成。您可以在[此处][2]找到有关如何手动设置这些任务的更多详细信息,或者如果您想通过命令行执行设置,这是一个特别有用的参考。
注意:必须设置宏和作业文件才能正常工作。
以编程方式完成此任务的一种方法是利用作业 API。下面是一个使用 VBA 完成此操作的示例:
请参阅此处参考
To resolve this I did the following:
Created a Macro named "Submit".
Created a Scheduled task
.job
file by going to:Start > All Programs > Accessories > System Tools > Schedule Tasks
(This produced the
.job
file in the following location: "C:\WINDOWS\Tasks\Submit.job")Once this was created, I placed the following syntax into the
Run:
text box.After this, the remaining portion of the setup is completed as a normal schedule task should be. You can find more details about how to manually setup these tasks [here][2] or if you like to perform the setup through the command line, this is a particularly useful reference.
Note: Both the Macro and the job file must be setup for this to work correctly.
One way to accomplish this programmatically would be do utilize the job API's. Here is one such example where this was accomplished using VBA:
See Reference Here
如果任务无法正常运行,可能是由于软件和/或服务包更新所致。检查 Microsoft Office 和 Access 的程序文件。运行行中显示的“Office11”可能需要更改为“Office 14”或“Office12”,具体取决于程序文件中显示的文件夹。
If the tasks do not run appropriately, it may be due to updates in software and/or service packs. Check the program files for Microsoft Office and Access. "Office11" as shown in the run line may need to be changed to "Office 14" or "Office12" depending on the folders showing in program files.