(Solved) – Excel VBA to determine if Workbook has focus


I have a subroutine invoked via Application.OnTime scheduled call.

How can I determine with Excel VBA whether the subroutine’s workbook is the focused application/process?

(If it is not the active application then I will run a code that blocks the process for a little bit. If it is active I don’t want to do that because I may be doing work in the workbook that I don’t want interrupted.)

Leave a Reply

Your email address will not be published. Required fields are marked *