PDA

View Full Version : VBA Code for Excel sheet access denied



siva
10-17-2007, 07:15 AM
Dear Friends,
Anyone have code for stop user to access excel file after certain date.

paulked
10-17-2007, 09:43 AM
Take a look here: http://vbaexpress.com/kb/getarticle.php?kb_id=475

Regards

Paul Ked

siva
10-18-2007, 07:20 AM
Dear Paul,
The example is good but i would like fix the end date as shown below

Private Sub Workbook_Open()
Dim Enddate As Date
Enddate 18/10/2007 22:15


If Format(Now) = Enddate Then
MsgBox "Sorry, you can not access this file anymore"
End Sub

regards

xld
10-18-2007, 07:22 AM
Is this any better http://www.cpearson.com/Excel/WorkbookTimeBomb.aspx

siva
10-18-2007, 07:38 AM
XLD,
It is good.
Thanks