Hi everyone,
I'm relatively new to VBA and was looking for a way to repeat an action in a spreadsheet. I stumbled across the Application.OnTime procedure and thought I'd give it a go.
I tried a piece of code I want to run when a workbook is opened and closed. I got the code to run on opening the workbook and at regular 5 minute intervals but when the workbook is closed, it throws up a Run-time error ‘1004’: Method ‘OnTime’ of object’_Application’ failed. The code is posted below.
![]()
Please Login or Register to view this content.
![]()
Please Login or Register to view this content.
Any help would be most welcome.![]()
Please Login or Register to view this content.
Bookmarks