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

I need to shut down open Excel workbooks at specific time
(e.g. 1 AM) to start data upload. This code will be
included with every workbook that must be closed before
the upload starts (the workbooks reside on a network
drive, but may stay open on different PC's due to users
no closing them, etc.).

Does anybody know the code or point me to a resource to
the trigger this update at the selected time?

Thanks for your help.

Lucy

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default Close Workbook Programmatically

I don't know of an easy way to do this.
The complicated way would probably involve checking the file system for who
has open locks, then killing their open locks. It could get messy.

You could maintain copies, ie. users work on a user file, uploads work on
the upload files.


"Lucy" wrote in message
...
I need to shut down open Excel workbooks at specific time
(e.g. 1 AM) to start data upload. This code will be
included with every workbook that must be closed before
the upload starts (the workbooks reside on a network
drive, but may stay open on different PC's due to users
no closing them, etc.).

Does anybody know the code or point me to a resource to
the trigger this update at the selected time?

Thanks for your help.

Lucy



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Close Workbook Programmatically

I think it is not really that difficult. All I need is a
trigger to start running the following sub (that will be
included in the workbook) at the selected time.

Sub Quit_Workbook()
With Application
.DisplayAlerts = False
.ThisWorkbook.Close False
.Quit
End With
End Sub

It's the trigger I am looking for that will shut down the
app at 1 AM without any user intervention (in MS Access I
can accomplish that with On Timer event).

I have the following code, but again I need another code
(trigger) to start this without anybody's intervention:

If Format(Now(), "Medium Time") = Format
("01:00:00, "Medium Time") Then
Application.OnTime Now + TimeValue
("00:0:05"), "Quit_Workbook"
End If

Do you know how the trigger this?

Thanks.

Lucy

-----Original Message-----
I don't know of an easy way to do this.
The complicated way would probably involve checking the

file system for who has open locks, then killing their
open locks. It could get messy.

You could maintain copies, ie. users work on a user

file, uploads work on the upload files.


"Lucy" wrote in

message
...
I need to shut down open Excel workbooks at specific

time
(e.g. 1 AM) to start data upload. This code will be
included with every workbook that must be closed before
the upload starts (the workbooks reside on a network
drive, but may stay open on different PC's due to users
no closing them, etc.).

Does anybody know the code or point me to a resource to
the trigger this update at the selected time?

Thanks for your help.

Lucy



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default Close Workbook Programmatically

You might have success with Application.OnTime TimeValue("17:00:00"),
"my_Procedure"

"Lucy" wrote in message
...
I think it is not really that difficult. All I need is a
trigger to start running the following sub (that will be
included in the workbook) at the selected time.

Sub Quit_Workbook()
With Application
.DisplayAlerts = False
.ThisWorkbook.Close False
.Quit
End With
End Sub

It's the trigger I am looking for that will shut down the
app at 1 AM without any user intervention (in MS Access I
can accomplish that with On Timer event).

I have the following code, but again I need another code
(trigger) to start this without anybody's intervention:

If Format(Now(), "Medium Time") = Format
("01:00:00, "Medium Time") Then
Application.OnTime Now + TimeValue
("00:0:05"), "Quit_Workbook"
End If

Do you know how the trigger this?

Thanks.

Lucy

-----Original Message-----
I don't know of an easy way to do this.
The complicated way would probably involve checking the

file system for who has open locks, then killing their
open locks. It could get messy.

You could maintain copies, ie. users work on a user

file, uploads work on the upload files.


"Lucy" wrote in

message
...
I need to shut down open Excel workbooks at specific

time
(e.g. 1 AM) to start data upload. This code will be
included with every workbook that must be closed before
the upload starts (the workbooks reside on a network
drive, but may stay open on different PC's due to users
no closing them, etc.).

Does anybody know the code or point me to a resource to
the trigger this update at the selected time?

Thanks for your help.

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
workbook before close mohavv Excel Discussion (Misc queries) 2 November 21st 07 01:27 AM
run macro on workbook close Nigel Excel Discussion (Misc queries) 3 November 29th 05 08:48 PM
close only one workbook bobsmom70601 New Users to Excel 1 March 8th 05 09:43 PM
programmatically close help file before Excel closes? RB Smissaert Excel Programming 2 July 21st 03 11:49 AM
cannot close workbook chrisneill Excel Programming 3 July 13th 03 11:10 PM


All times are GMT +1. The time now is 09:24 AM.

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

About Us

"It's about Microsoft Excel"