![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Mar 2002
Posts: 3
|
Today is 28.MAR.2002
A1 is 27.mar.2002 if file is open today it should not work in anyway but just close. |
|
|
|
|
|
#2 |
|
BatCoder
Join Date: Feb 2002
Location: Turkey
Posts: 764
|
Double click on thisworkbook object in VBA project and open the code. Then find the Sub Workbook_Open and use the code below..
'Assume you dont want to show sheet1 Private Sub Workbook_Open() If Sheet1.Cells(1, 1) < Now() Then Close False Else 'This part avoid using sheet1 if user opens the workbook by clicking Disable Macros. So you need to set Sheet1.Visible property in Propertie window to 2 (xlSheetVeryHidden) Sheet1.Visible = xlSheetVisible End If End Sub 'To make sheet1 xlVeryHidden before closing workbook (after making some changes etc) Private Sub Workbook_BeforeClose(Cancel As Boolean) Sheet1.Visible = xlSheetVeryHidden End Sub Or some other ways like protecting and unprotecting sheets in code with this way. regards |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|