Consulting

Results 1 to 5 of 5

Thread: Disable printing and macros from specific date

  1. #1

    Disable printing and macros from specific date

    I want to ensure uses a new version of my spreadsheet at a later date so I want to:

    1
    Prevent printing from a specific date

    2
    Prevent macro from running from a specific date.

    Yes perhaps the user could change the system clock but then I would know that they must have done that if I see the output.

    Is it possible?

    Thanks

  2. #2
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    [vba]
    Private Sub Workbook_Open()
    If Date => Someday Then Me.Close
    End Sub
    [/vba]

  3. #3
    Thanks very much

  4. #4
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    You could also refer to Document Properties
    [VBA]
    Private Sub Workbook_Open()
    If Date - ActiveWorkbook.BuiltinDocumentProperties("Creation date") > 7 Then
    Me.Close
    End If
    End Sub

    [/VBA]
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  5. #5
    Quote Originally Posted by mdmackillop
    You could also refer to Document Properties
    [vba]
    Private Sub Workbook_Open()
    If Date - ActiveWorkbook.BuiltinDocumentProperties("Creation date") > 7 Then
    Me.Close
    End If
    End Sub

    [/vba]
    Thanks, bu if they use Save as don't they get a new Creation Date?

Posting Permissions

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