Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 96
Default Do not open spreadsheet before a certain time.

What VBA would I write to keep users form opening a file before 10:00 am
everyday?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Do not open spreadsheet before a certain time.

This is an extract from the Microsoft Excel XP VBA help file.
Regards,
Wayneg

'================================================= ====
Wait Method
See Also Applies To Example Specifics
Pauses a running macro until a specified time. Returns True if the specified
time has arrived.

Important The Wait method suspends all Microsoft Excel activity and may
prevent you from performing other operations on your computer while Wait is
in effect. However, background processes such as printing and recalculation
continue.

expression.Wait(Time)

expression Required. An expression that returns an Application object.

Time Required Variant. The time at which you want the macro to resume, in
Microsoft Excel date format.

Example
This example pauses a running macro until 6:23 P.M. today.

Application.Wait "18:23:00"
This example pauses a running macro for approximately 10 seconds.

newHour = Hour(Now())
newMinute = Minute(Now())
newSecond = Second(Now()) + 10
waitTime = TimeSerial(newHour, newMinute, newSecond)
Application.Wait waitTime
This example displays a message indicating whether 10 seconds have passed.

If Application.Wait(Now + TimeValue("0:00:10")) Then
MsgBox "Time expired"
End If
'================================================= ====

"Qaspec" wrote:

What VBA would I write to keep users form opening a file before 10:00 am
everyday?

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
Spreadsheet will not open without Excel Application being open fir Deirdre Lysaght Excel Discussion (Misc queries) 1 November 13th 07 04:11 PM
Long time to open spreadsheet (running Excel 2007) Gollom Excel Discussion (Misc queries) 0 March 28th 07 12:59 AM
Have date automatically update each time I open the spreadsheet Beth1415 Excel Discussion (Misc queries) 3 November 6th 06 09:14 PM
How do I stop Excel from closing the open file each time I open a. Welsin Setting up and Configuration of Excel 3 January 8th 05 11:16 PM
How to open another Excel spreadsheet to copy data into current spreadsheet ? Ricky Pang Excel Programming 0 July 13th 03 01:59 PM


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