Autoclose excel file after x minutes of inactivity

H

Hardhit

Hello,

Is there a possibility to automatically close an excel file after for
example 5 minutes of inactivity on the file ?

We have at our company for each department a file in which they need to fill
in production data. 2 times per day this data is collected into an overview
file.
But I often have to call the departments to ask them to close the file so
that I can run the collection macro's.

Regards,
Peter
 
J

john

Not sure about detecting inactivity using VBA but one route may be to
consider adding an OnTime routine which would call a procedure to close the
workbook after 5 mins or whatever you want - However, this does rely on users
enabling macro's.

Chip Pearson has some woking examples:
http://www.cpearson.com/excel/OnTime.aspx
 
M

Mike H.

Perhaps a better way would be to have the spreadsheet auto-save when new data
is entered in it. Then it wouldn't really matter if they closed it or not.
You could open it read-only and get the data out. To do this you could set
up a counter that counts entries, read that # when you first open the
spreadsheet and when it changes initiate a save routine.

An even better solution would be to write the data to an external
data-source like an access file. Then you wouldn't care if they were in the
spreadsheet or not because you would read the data out of access (or you
could read it in excel but it would be stored in Access). There are examples
for doing this on this discussion gruop, or I could set it up for you.
 
S

Sandy Mann

workbook after 5 mins or whatever you want - However, this does rely on
users
enabling macro's.

In addition if the sheet is left in edit mode the macro will not run either.

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings

(e-mail address removed)
Replace @mailinator.com with @tiscali.co.uk
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top