运行 个不同的 excel 宏来自不同时间的一个 vbscript
Running different excel macros from one vbscript at different hours
我想使用 vbs 文件 - 它将在不同的时间触发不同的宏 .我正在考虑将其放入 windows 启动程序 文件夹
关键是我希望这个 vbs 在不同的时间触发这些宏中的每一个(假设我的机器足够长)。
我尝试为每个宏创建单独的 vbs 文件并使用 windows 调度程序启动它。它有效,但我不喜欢这个解决方案,我想学习 smth。要明确我想要实现的是:
Launching Computer at 12 -> VBScript is launching at windows start,
then it fires:
Macro a at 13, and update it on 13.15
Macro b at 15
then Macro c at 16 using data from Macro b, and then closing itself
(both macro and vbs).
OFC 我将启动计算机并手动关闭它:)
谢谢,
大卫
您应该可以使用计时器功能来做到这一点,该功能 returns 自午夜以来的秒数。
https://msdn.microsoft.com/en-us/library/office/gg264416.aspx
为确保它不是每秒都检查一次,请尝试使用 Wait 函数。
https://msdn.microsoft.com/en-us/library/office/ff822851.aspx
我还是新手,所以希望其他人能为您详细介绍这一点,但这应该是一个很好的起点。
我想使用 vbs 文件 - 它将在不同的时间触发不同的宏 .我正在考虑将其放入 windows 启动程序 文件夹
关键是我希望这个 vbs 在不同的时间触发这些宏中的每一个(假设我的机器足够长)。
我尝试为每个宏创建单独的 vbs 文件并使用 windows 调度程序启动它。它有效,但我不喜欢这个解决方案,我想学习 smth。要明确我想要实现的是:
Launching Computer at 12 -> VBScript is launching at windows start, then it fires:
Macro a at 13, and update it on 13.15
Macro b at 15
then Macro c at 16 using data from Macro b, and then closing itself (both macro and vbs).
OFC 我将启动计算机并手动关闭它:)
谢谢, 大卫
您应该可以使用计时器功能来做到这一点,该功能 returns 自午夜以来的秒数。
https://msdn.microsoft.com/en-us/library/office/gg264416.aspx
为确保它不是每秒都检查一次,请尝试使用 Wait 函数。
https://msdn.microsoft.com/en-us/library/office/ff822851.aspx
我还是新手,所以希望其他人能为您详细介绍这一点,但这应该是一个很好的起点。