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.
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.
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
>
>
JMB
I just read your reply, it sounds good i will do it.
thank you
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks