Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default auto closing a work book

is there a program that can be written that will close a workbook and make it
read only at a certain time and then reopen it at another specified time? I
am runing office and window xp professional.

thanks in advance for any help!!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 158
Default auto closing a work book

To make a workbook readonly (or make a readonly workbook write) you
don't need to close it. Just use:

Sub MakeWorkbookReadonly()
'you may like to check whether the user should save their work
If not thisworkbook.readonly then _
thisworkbook.ChangeFileAccess Mode:=xlReadOnly
End sub

Sub MakeWorkbookWrite()
If thisworkbook.readonly then _
thisworkbook.ChangeFileAccess Mode:=xlReadwrite
End sub

To do this at a certain time is a little trickier. One way is to set
OnTime procedures, say at workbook open. I would play with various
methods and see which one works best for you.

Sub SetModeSwitching()

Application.OnTime TimeValue("15:00:00"), "MakeWorkbookReadonly"
Application.OnTime TimeValue("16:00:00"), "MakeWorkbookWrite"

End Sub


HTH,
Gareth

myssieh wrote:
is there a program that can be written that will close a workbook and make it
read only at a certain time and then reopen it at another specified time? I
am runing office and window xp professional.

thanks in advance for any help!!

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
Running Total, Opening & Closing Acct Balance in Cash Book rushdhih Excel Worksheet Functions 1 February 2nd 10 05:31 PM
No need of save change confirmation at closing book Shariq Excel Discussion (Misc queries) 3 January 10th 07 09:26 PM
auto numbering an exel work book sheet everytime it opens or print Rugby Al Excel Discussion (Misc queries) 1 July 19th 05 06:20 PM
Is there away to keep "auto save" from jumping to the first work sheet in the work book? Marc New Users to Excel 2 April 21st 05 01:27 AM
simultaneously work in a work book with other users Sweets Excel Discussion (Misc queries) 1 April 18th 05 07:35 PM


All times are GMT +1. The time now is 04:31 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"