+ Reply to Thread
Results 1 to 5 of 5

Time bomb not working

Hybrid View

  1. #1
    Registered User
    Join Date
    03-04-2009
    Location
    grantham
    MS-Off Ver
    Excel 2003
    Posts
    10

    Time bomb not working

    ROY UK kindly gave me a solution regarding expiry dates on an excel spread sheet using this coding, fantastic and works the only problem is,if the security setting on someone's machine is set to high the macro doesnt work and they can disable them so the time bomb does not work , i have set auto_run but this does not solve it

    Private Sub Workbook_Open()
        'check if a start date exists
        If IsEmpty(Sheets("Hidden").Cells(1, 1)) Then
            'none exists so add today's date
            Sheets("Hidden").Cells(1, 1).Value = Date
            'if a start date has been recorded, check if it is less than 30 days from start
        ElseIf Date >= Sheets("Hidden").Cells(1, 1).Value + 2 Then
            'alert user that it has expired
            MsgBox "Trial period has expired ", vbOKOnly, "Trial Period Expired"
            'close the workbook without saving
            ThisWorkbook.Close (False)
        End If
    End Sub
    Last edited by go2review; 03-23-2009 at 11:53 AM. Reason: add code tags

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Time bomb not working

    Please edit your post to add code tags.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile Re: Time bomb not working

    Good afternoon go2review
    Quote Originally Posted by go2review View Post
    the only problem is,if the security setting on someone's machine is set to high the macro doesnt work and they can disable them so the time bomb does not work
    This is a Microsoft security feature and there is no sure-fire way around it (apart from not using Excel if you want to use DRM type techniques). There are a couple of tricks on Chip Pearsons page to help out, but you need to remember that there will always be someone who can pick apart your workbook :

    http://www.cpearson.com/Excel/EnableMacros.aspx
    http://www.cpearson.com/Excel/EnableMacros2.aspx

    HTH

    DominicB
    Please familiarise yourself with the rules before posting. You can find them here.

  4. #4
    Registered User
    Join Date
    09-04-2014
    Location
    Thailand
    MS-Off Ver
    2013
    Posts
    16

    Re: Time bomb not working

    Quote Originally Posted by go2review View Post
    ROY UK kindly gave me a solution regarding expiry dates on an excel spread sheet using this coding, fantastic and works the only problem is,if the security setting on someone's machine is set to high the macro doesnt work and they can disable them so the time bomb does not work , i have set auto_run but this does not solve it

    Private Sub Workbook_Open()
        'check if a start date exists
        If IsEmpty(Sheets("Hidden").Cells(1, 1)) Then
            'none exists so add today's date
            Sheets("Hidden").Cells(1, 1).Value = Date
            'if a start date has been recorded, check if it is less than 30 days from start
        ElseIf Date >= Sheets("Hidden").Cells(1, 1).Value + 2 Then
            'alert user that it has expired
            MsgBox "Trial period has expired ", vbOKOnly, "Trial Period Expired"
            'close the workbook without saving
            ThisWorkbook.Close (False)
        End If
    End Sub
    Hi, I'm wanting something very similar. How many days is this set to? And how do you set the start date? Also, does this go into the, 'this workbook' part of the VBA?

  5. #5
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Time bomb not working

    Hi, ThomasAnthony,

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.

    30 days, yes.

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for 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