Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi...
Is it possible to code a macro so that a file won't open after a certain date? Cheers Gordon... |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi, put this code in the ThisWorkbook module:
Private Sub Workbook_Open() If DateValue(Now()) DateValue("29/09/2008") Then ThisWorkbook.Close False End Sub Change the "29/09/2008" to whatever date you want. The False after the ThisWorkbook.Close is to save the changes. Hope this helps. On 29 Sep, 14:35, Gordon wrote: Hi... Is it possible to code a macro so that a file won't open after a certain date? Cheers Gordon... |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You can also control it within the macro with an If ... Then statement:
Sub myMacro() If Date = DateValue("October 1, 2008") Then Exit Sub End If 'myMacro Code End Sub "Gordon" wrote: Hi... Is it possible to code a macro so that a file won't open after a certain date? Cheers Gordon... |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Gordon,
It's extremely unlikely that any VB method would deter even a slightly experienced user or a novice with access to Google. Both of replies you have require macros enabled and if they aren't enable then the code doesn't execute and the workbook opens. Have a look at Chip Pearson's site who explores the problem in some depth and points aout the shortcomings of any VB approach. http://www.cpearson.com/excel/WorkbookTimeBomb.aspx Mike "Gordon" wrote: Hi... Is it possible to code a macro so that a file won't open after a certain date? Cheers Gordon... |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
limit on [h]:mm time format? | Excel Discussion (Misc queries) | |||
Time limit restriction. | Excel Programming | |||
macro to time limit workbook | Excel Discussion (Misc queries) | |||
set time limit before closing sheet | Excel Programming | |||
Excel solver time limit | Excel Programming |