Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Auto Close Excel Workbook

Hi,
I need to ensure that a user has closed their Excel Workbook. I have added
the following code and Excel will do this but insists on asking the user to
click a messagebox OK button to note the system is closing. Is there a way
around this so that Excel will close even if a user is not there?. The
workbook contains other code to ensure all changes are saved after input
(via a userform) so I have no need to save the file prior to closing it.
The user is made aware when they open the Workbook that it will
automatically close after 30 minutes, hence I just need to be able to shut
it down remotely when a user has gone home and inadvertently left the file
open.

Thanks,
Mickey
================================================== ======
--- Module Code ---

Private Sub KillTheApp()
'
'
ThisWorkbook.Close savechanges:=False 'true ???
End Sub
================================================== ======
--- Workbook Code ---

Application.OnTime Now + TimeValue("00:30:00"), "KillTheApp"
================================================== ======


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Auto Close Excel Workbook

One possible alternative is the DisplayAlerts property of the Application
object in Excel. I cannot guarantee it will work in your situation, but it
is one option you may want to look into.

--
David Lloyd
MCSD .NET
http://LemingtonConsulting.com

This response is supplied "as is" without any representations or warranties.


"MBlake" wrote in message
...
Hi,
I need to ensure that a user has closed their Excel Workbook. I have added
the following code and Excel will do this but insists on asking the user to
click a messagebox OK button to note the system is closing. Is there a way
around this so that Excel will close even if a user is not there?. The
workbook contains other code to ensure all changes are saved after input
(via a userform) so I have no need to save the file prior to closing it.
The user is made aware when they open the Workbook that it will
automatically close after 30 minutes, hence I just need to be able to shut
it down remotely when a user has gone home and inadvertently left the file
open.

Thanks,
Mickey
================================================== ======
--- Module Code ---

Private Sub KillTheApp()
'
'
ThisWorkbook.Close savechanges:=False 'true ???
End Sub
================================================== ======
--- Workbook Code ---

Application.OnTime Now + TimeValue("00:30:00"), "KillTheApp"
================================================== ======



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Auto Close Excel Workbook

Cheers David, I'll take a look and see if I can work it out.

Mickey


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
auto close workbook [email protected] uk Excel Discussion (Misc queries) 2 December 6th 09 09:02 PM
Auto Close A Workbook...With Two Twists! jwleonard[_5_] Excel Programming 0 September 18th 04 09:49 PM
Auto Close A Workbook...With Two Twists! jwleonard[_4_] Excel Programming 0 September 18th 04 08:48 AM
Auto Close A Workbook...With Two Twists! jwleonard[_3_] Excel Programming 0 September 17th 04 07:29 AM
Auto Close function in Excel Ian M Excel Programming 1 April 28th 04 03:51 AM


All times are GMT +1. The time now is 05:56 PM.

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"