Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
close file macro
Hi I could use a little help. I want to make a macro that will close a file if it is opened between two times (6 am and 7 am)? Any suggestions would be appreciated. -- Tizy ------------------------------------------------------------------------ Tizy's Profile: http://www.excelforum.com/member.php...o&userid=25275 View this thread: http://www.excelforum.com/showthread...hreadid=387678 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
close file macro
Maybe something like this? Paste into the ThisWorkBook module in VBA. Also,
would like to point out that the file could still be opened by holding the SHIFT key while opening the file (which prevents auto open macros from running). Private Sub Workbook_Open() Const BeginTime = #6:00:00 AM# Const EndTime = #7:00:00 AM# If Time BeginTime And Time < EndTime Then _ Me.Close End Sub "Tizy" wrote: Hi I could use a little help. I want to make a macro that will close a file if it is opened between two times (6 am and 7 am)? Any suggestions would be appreciated. -- Tizy ------------------------------------------------------------------------ Tizy's Profile: http://www.excelforum.com/member.php...o&userid=25275 View this thread: http://www.excelforum.com/showthread...hreadid=387678 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
close file macro
JMB I just read your reply, it sounds good i will do it. thank you -- Tizy ------------------------------------------------------------------------ Tizy's Profile: http://www.excelforum.com/member.php...o&userid=25275 View this thread: http://www.excelforum.com/showthread...hreadid=387678 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to Open, then Close another File | Excel Discussion (Misc queries) | |||
Close file and run macro from newly opened file | Excel Programming | |||
use a macro to close a file | Excel Programming | |||
close file macro | Excel Programming | |||
Automate open file, update links, run macro, close and save file | Excel Programming |