Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Close Open Workbook
Lucy
I'm no MVP but some digging through the groups suggests that http://www.cpearson.com/excel/ontime.htm may well provide you with what you're looking for (combined with the application.quit etc that you already know about). Hope this helps in some way David "Lucy" wrote in message ... This is my third posting of the same question in the past couple weeks with no solution in sight. I am getting little cranky with all the help for everything else, but what I need. Here is the problem: I need to be able to close any open Excel file before I start an upload. These files are located on a mainframe and people all over the place leave the apps open when they go home, thus preventing me from doing my upload. I do know the code how the close the workbooks, so please do not offer it. All I need is the code to trigger it. Therefore if the file stays open past specific time (e.g. 1 AM) this event will come into play and close the app (similar to On Timer event in Access). In laymen terms: If the time is 1:00 AM and the workbook is still open, QUIT IT (all without any user interaction). Like a timer on your TV. Does anybody (including the Excel MVP's) know a code how to trigger this when all the users left the office with the workbooks open? Thank you. Lucy |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Close Open Workbook
Thank you for the source of info, but I have used
different idea suggested by Bob Umlas: Public Sub Auto_Open() Application.OnTime TimeValue ("01:00:00"), "Quit_Workbook" End Sub Sub Quit_Workbook() With Application .DisplayAlerts = False .Quit End With End Sub This works great but I will also explore the source you suggested. Thank you. Lucy -----Original Message----- Lucy I'm no MVP but some digging through the groups suggests that http://www.cpearson.com/excel/ontime.htm may well provide you with what you're looking for (combined with the application.quit etc that you already know about). Hope this helps in some way David "Lucy" wrote in message ... This is my third posting of the same question in the past couple weeks with no solution in sight. I am getting little cranky with all the help for everything else, but what I need. Here is the problem: I need to be able to close any open Excel file before I start an upload. These files are located on a mainframe and people all over the place leave the apps open when they go home, thus preventing me from doing my upload. I do know the code how the close the workbooks, so please do not offer it. All I need is the code to trigger it. Therefore if the file stays open past specific time (e.g. 1 AM) this event will come into play and close the app (similar to On Timer event in Access). In laymen terms: If the time is 1:00 AM and the workbook is still open, QUIT IT (all without any user interaction). Like a timer on your TV. Does anybody (including the Excel MVP's) know a code how to trigger this when all the users left the office with the workbooks open? Thank you. Lucy . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Open and Close a Workbook to Update Links | Excel Discussion (Misc queries) | |||
Open a workbook, Copy several cells, then Close the previously openedworkbook | Excel Worksheet Functions | |||
Macro to close workbook and re-open new copy | Excel Discussion (Misc queries) | |||
How can I close only 1 workbook when I have many open? | Excel Discussion (Misc queries) | |||
very difficult code that will close original workbook and leave another open | Excel Programming |