I'm having a bit of a weird issue with a particular spreadsheet. It's used by a lot of people so I've tried to get it to close down after 10 minutes of inactivity, as well as do a couple of other little things (mainly remove any filters that have been applied) before it closes.
The trouble I'm having is that the timed inactivity loop seems to remain active even after the spreadsheet has closed. When the loop runs out the macro manages to reload the spreadsheet but then produces an error because the variable is blank (presumably since the spreadsheet has been closed).
I can't work out what's going on. Here's the code in ThisWorkbook:
and here's what's in a module:
Any thoughts would be appreciated. Thanks!
Bookmarks