ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Autoclose excel file after x minutes of inactivity (https://www.excelbanter.com/excel-programming/407288-autoclose-excel-file-after-x-minutes-inactivity.html)

Hardhit

Autoclose excel file after x minutes of inactivity
 
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

John

Autoclose excel file after x minutes of inactivity
 
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
--
JB


"Hardhit" wrote:

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


Mike H.

Autoclose excel file after x minutes of inactivity
 
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.


Sandy Mann

Autoclose excel file after x minutes of inactivity
 
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


Replace @mailinator.com with @tiscali.co.uk


"john" wrote in message
...
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
--
JB


"Hardhit" wrote:

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






All times are GMT +1. The time now is 10:15 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com