+ Reply to Thread
Results 1 to 3 of 3

Disable printing and macros from specific date

Hybrid View

  1. #1
    Registered User
    Join Date
    02-22-2010
    Location
    Solihull
    MS-Off Ver
    Excel 2003
    Posts
    14

    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
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Disable printing and macros from specific date

    i think
    Private Sub Workbook_BeforePrint(Cancel As Boolean)
     Dim enddate As Date
        enddate = "03/25/2010"
        If Date >= enddate Then
          Cancel = True
      End If
    End Sub
    should do it for print . but could easily be defeated by copy paste to another workbook
    then
    for macro
    Sub endit()
        Dim enddate As Date
        enddate = "03/25/2010"
        If Date >= enddate Then
            Exit Sub
        End If
        'your code here
    End Sub
    Last edited by martindwilson; 03-25-2010 at 09:57 AM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    02-22-2010
    Location
    Solihull
    MS-Off Ver
    Excel 2003
    Posts
    14

    Re: Disable printing and macros from specific date

    Thank you.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1