[CLOCK TIMED ACTION]

huangapple go评论59阅读模式
英文:

[CLOCK TIMED ACTION]

问题

寻找一个能够在每天晚上9:00激活我创建的名为“IV”的函数的代码。我尝试过跟随其他脚本,但无法根据时间激活该函数。

英文:

Looking for a code to activate a function that i made called "IV" at 9:00 pm every day.

i tried following some other scripts but i can get it to activate the function using clock time.

答案1

得分: 0

I assume you're using windows. You could use a sleep function to control the process, but when you run macros you can't access your sheets in excel. VBA is not really set up for this type of thing so I propose another method.

Open up visual basic and put this in Thisworkbook:

Private Sub Woorbook_Open()
    yourmacro.IV() 
    ThisWorkbook.Close()
End Sub

Where you just substitute the names of yourmacro with the name of the macro file which contains your prodedure called IV. This will run when the workbook is opened by the task scheduler, run the procedure, then close the workbook.

Then make a new task using windows task scheduler that opens this workbook at 9pm every night. (tutorial here: https://datacornering.com/how-to-run-excel-file-from-windows-10-task-scheduler/)

英文:

I assume you're using windows.

You could use a sleep function to control the process, but when you run macros you can't access your sheets in excel. VBA is not really set up for this type of thing so I propose another method.

Open up visual basic and put this in Thisworkbook:

Private Sub Woorbook_Open()
    yourmacro.IV() 
    ThisWorkbook.Close()
End Sub

Where you just substitute the names of yourmacro with the name of the macro file which contains your prodedure called IV.

This will run when the workbook is opened by the task scheduler, run the procedure, then close the workbook.

Then make a new task using windows task scheduler that opens this workbook at 9pm every night. (tutorial here: https://datacornering.com/how-to-run-excel-file-from-windows-10-task-scheduler/)

huangapple
  • 本文由 发表于 2023年2月6日 13:28:44
  • 转载请务必保留本文链接:https://go.coder-hub.com/75357624.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定