Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default 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   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Open and Close a Workbook to Update Links [email protected] Excel Discussion (Misc queries) 3 July 7th 08 07:55 PM
Open a workbook, Copy several cells, then Close the previously openedworkbook [email protected] Excel Worksheet Functions 0 April 9th 08 11:54 PM
Macro to close workbook and re-open new copy Dave Lagergren Excel Discussion (Misc queries) 2 February 28th 07 10:11 PM
How can I close only 1 workbook when I have many open? jpt consulting Excel Discussion (Misc queries) 3 November 30th 04 11:58 PM
very difficult code that will close original workbook and leave another open reesmacleod Excel Programming 4 December 3rd 03 11:21 PM


All times are GMT +1. The time now is 12:26 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"