Consulting

Results 1 to 5 of 5

Thread: VBA Code for Excel sheet access denied

  1. #1
    VBAX Regular
    Joined
    Oct 2007
    Posts
    19
    Location

    VBA Code for Excel sheet access denied

    Dear Friends,
    Anyone have code for stop user to access excel file after certain date.

  2. #2
    VBAX Expert paulked's Avatar
    Joined
    Apr 2006
    Posts
    613
    Location
    Take a look here: http://vbaexpress.com/kb/getarticle.php?kb_id=475

    Regards

    Paul Ked
    Semper in excretia sumus; solum profundum variat.

  3. #3
    VBAX Regular
    Joined
    Oct 2007
    Posts
    19
    Location
    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

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master xld's Avatar
    Joined
    Apr 2005
    Posts
    25,147
    Location
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    VBAX Regular
    Joined
    Oct 2007
    Posts
    19
    Location
    XLD,
    It is good.
    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •