Consulting

Results 1 to 6 of 6

Thread: Solved: Set a Trial Period For Use of Your Project

  1. #1
    VBAX Regular
    Joined
    Oct 2005
    Posts
    33
    Location

    Solved: Set a Trial Period For Use of Your Project

    I refer directly to the KB on the above subject. This works beautifully! we have 30+ people using an excel application remotely which I designed and update. It is protected as best we can however I would like the ability to "kill" the application if someone leaves us, or have the ability to change the "trial" period. Every day or two we send out an add-on worksheet to the application. It includes variables needed for the main workbook. I thought I could use this to store a "kill" cell which has a lower trial period duration. For example, if the original link was for say 35 days, it would allow for monthly updates to supercede the expiry date. However, if someone was to leave (or we suspected someone was going to leave us), I would ike to be able to change that time to say 30 minutes.

    Any thoughts?

  2. #2
    Administrator
    Chat VP
    VBAX Guru johnske's Avatar
    Joined
    Jul 2004
    Location
    Townsville, Australia
    Posts
    2,872
    Location
    Hi Derek,

    In all conscience I'm not sure I can answer this. I'm not saying it can't be done, but what you're asking for is basically a Virus that's going to be enclosed in an email to kill a workbook on someone elses computer. (And a workbook that was given to them with the understanding that they had full use of it for a given period of time to boot).

    This could so easily be changed to a procedure to kill any (all) workbooks on the others computer.

    Regards,
    John
    You know you're really in trouble when the light at the end of the tunnel turns out to be the headlight of a train hurtling towards you

    The major part of getting the right answer lies in asking the right question...


    Made your code more readable, use VBA tags (this automatically inserts [vba] at the start of your code, and [/vba ] at the end of your code) | Help those helping you by marking your thread solved when it is.

  3. #3
    Administrator
    Chat VP VBAX Guru johnske's Avatar
    Joined
    Jul 2004
    Location
    Townsville, Australia
    Posts
    2,872
    Location
    Probably the best I can offer is code to reset the trial period. This would have to be sent as a zipped file and you would have to depend on the person at the other end opening the workbook...

    On opening, the trial period is reset (but if they wake up to what's happening they could constantly extend this by opening the zipped file whenever they wanted to use the other book) [vba]Private Sub Workbook_Open()
    Dim StartTime#, CurrentTime#

    '*****************************************
    'SET YOUR OWN TRIAL PERIOD BELOW
    'Integers (1, 2, 3,...etc) = number of days use
    '1/24 = 1Hr, 1/48 = 30Mins, 1/144 = 10Mins use

    Const TrialPeriod# = 1 / 48 '< 30 minutes trial

    'set your own obscure path and file-name
    '(to re-set the period you would already
    'know the path and file you used)
    Const ObscurePath$ = "C:\"
    Const ObscureFile$ = "TestFileLog.Log"
    '*****************************************
    StartTime = Format(Now, "#0.#########0")
    Open ObscurePath & ObscureFile For Output As #1
    Print #1, StartTime
    Close #1
    End Sub[/vba]
    You know you're really in trouble when the light at the end of the tunnel turns out to be the headlight of a train hurtling towards you

    The major part of getting the right answer lies in asking the right question...


    Made your code more readable, use VBA tags (this automatically inserts [vba] at the start of your code, and [/vba ] at the end of your code) | Help those helping you by marking your thread solved when it is.

  4. #4
    Administrator
    Chat VP VBAX Guru johnske's Avatar
    Joined
    Jul 2004
    Location
    Townsville, Australia
    Posts
    2,872
    Location
    Correction: Sorry, what I gave you above would actually extend the trial period (the start time). What you need to do is work out how much time they have left and then subtract what you need to...

    E.G. If they have 30 days plus 30 minute use left you would use [vba]StartTime = Format(Now - 30, "#0.#########0")[/vba]or, in full[vba]Option Explicit
    Sub ResetTrialPeriod()
    Dim StartTime#
    '*****************************************
    'set your own obscure path and file-name
    '(to re-set the period you would already
    'know the path and file you used)
    Const ObscurePath$ = "C:\"
    Const ObscureFile$ = "TestFileLog.Log"
    '*****************************************
    StartTime = Format(Now - 30, "#0.#########0")
    Open ObscurePath & ObscureFile For Output As #1
    Print #1, StartTime
    Close #1
    End Sub[/vba]
    You know you're really in trouble when the light at the end of the tunnel turns out to be the headlight of a train hurtling towards you

    The major part of getting the right answer lies in asking the right question...


    Made your code more readable, use VBA tags (this automatically inserts [vba] at the start of your code, and [/vba ] at the end of your code) | Help those helping you by marking your thread solved when it is.

  5. #5
    VBAX Regular
    Joined
    Oct 2005
    Posts
    33
    Location
    Johnske
    Thanks very much for this. I have tested this out and it works exactly as I wanted. Please be assured that our intentions are definitely genuine.

    Thank you so much for your efforts and input

    Derek

  6. #6
    BoardCoder
    Licensed Coder VBAX Expert mark007's Avatar
    Joined
    May 2004
    Location
    Leeds, UK
    Posts
    622
    Location
    Thought twice about posting this but I don't believe it to be particularly malicious given that it's easy to craete a macro to delete some files anyway - there is always an element of trust when you open a workbook with macros. You want to use a modified version of somethign like this:

    http://www.thecodenet.com/articles.php?id=28

    This is based on an exe but the principle is the same.

    "Computers are useless. They can only give you answers." - Pablo Picasso
    Mark Rowlinson FIA | The Code Net

Posting Permissions

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