Reputation: 347
I currently have on OnTime Function (below) that isn't working.
Sub DeleteAllZeros()" 'All of these are defined and work perfectly'
ApagarZerosLCA
ApagarZerosLCAFEC
ApagarZerosLCA_ACC
ApagarZerosLCA_ACC_FEC
ApagarZerosLCI
ApagarZerosLCIFEC
End Sub
Private Sub AutoDeleteZeros()
Application.OnTime TimeValue("15:32:00"), "DeleteAllZeros"
End Sub
Can anyone explain why this isn't working? Also (likely dumb questions), how would I have it so that this would run if the workbook is closed? Is it possible to have it run if the computer is locked, shut down, or logged off?
Thanks!
Upvotes: 1
Views: 1840
Reputation: 746
Application.OnTime works in the Windows implementation. As of 3/27/2021, it does not work on an Apple Mac Mini M1.
I ran the following test code to verify it's a bug in Microsoft's VBA interpreter. The Message box never appears unless testboo is run directly. I lifted the Ontime call from Microsoft's documentation.
Sub testtime()
Application.OnTime Now + TimeValue("00:00:15"), "testboo"
End Sub
Sub testboo()
MsgBox ("boo")
End Sub
Upvotes: 0