+ Reply to Thread
Results 1 to 15 of 15

Set a Trial Period For Use of Your Project

  1. #1
    Forum Contributor
    Join Date
    06-25-2012
    Location
    Porto, Portugal
    MS-Off Ver
    Excel 2010
    Posts
    201

    Set a Trial Period For Use of Your Project

    Hi again... i've been looking around in google so i can define a way to get a trial period and came acrosse with this code:
    Please Login or Register  to view this content.
    This code does exactly what i want and i really want it to create a log file or any other type of file that records the date for expiracy purposes. The problem is when i open the workbook with this macro on it shows this error: Runtime Error '75': Path/File acess error.

    Don't know what is wrong. I've tried to change the Log file to TestFileLog.txt and nothing, same error again on openning.
    When i debbug it a yellow line appears over this: "Open ObscurePath & ObscureFile For Output As #1"

  2. #2
    Forum Contributor
    Join Date
    06-25-2012
    Location
    Porto, Portugal
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Set a Trial Period For Use of Your Project

    Anybody can help on this error please?

  3. #3
    Forum Contributor
    Join Date
    06-25-2012
    Location
    Porto, Portugal
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Set a Trial Period For Use of Your Project

    I've found that if i erase the directory "C:\" and let the code as Const ObscurePath$ = ""
    Const ObscureFile$ = "TestFileLog.Log" it now creates the TestfileLog file but this file goes to My Documents automaticlly. I would like to put it somewhere in windows folder so it can be "hidden" from users. In My Documents is to visible. Just don't know how to make the path cause everytime i use "C:\Windows\" it gives the same error 75. Guess cannot write on C:\ but i'm the admin of the computer and i'm logged as admin besides i can create o My Documents which is located in C:\, so i dont understand why i cant direct to create the file where i want! I'm using Excel 2007

  4. #4
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Set a Trial Period For Use of Your Project

    You could try changing the default folder just before your file opening.

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    06-25-2012
    Location
    Porto, Portugal
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Set a Trial Period For Use of Your Project

    Change the default folder? But the this file is suposed to open by any person in any computer. So i cant instruct every person that downloads the file to change directories because they will know where the log file is hidden. Dont really know what you mean by that sollution sorry. And where do i put that code in the one i already have? Here is a file with the code i have so you can check it out. Thank you for your reply and your help.
    Attached Files Attached Files
    Last edited by Taislin; 12-13-2012 at 03:12 PM.

  6. #6
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Set a Trial Period For Use of Your Project

    I was thinking something like this.

    Please Login or Register  to view this content.

  7. #7
    Valued Forum Contributor
    Join Date
    11-15-2008
    Location
    ph
    MS-Off Ver
    2007/2010/2016
    Posts
    479

    Re: Set a Trial Period For Use of Your Project

    Hi -

    Use registry, much better approach
    Please Login or Register  to view this content.
    Regards,
    Event

  8. #8
    Forum Contributor
    Join Date
    06-25-2012
    Location
    Porto, Portugal
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Set a Trial Period For Use of Your Project

    @mrice,

    I tried but then got this error... see in attached image.

    Moderator's Note: As per Forum Rule #12, don't quote whole posts unless necessary-- it's just clutter...Thanks.
    Attached Images Attached Images

  9. #9
    Forum Contributor
    Join Date
    06-25-2012
    Location
    Porto, Portugal
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Set a Trial Period For Use of Your Project

    @event21,

    Gonna try it. Thank you.

    Moderator's Note: As per Forum Rule #12, don't quote whole posts unless necessary-- it's just clutter...Thanks.

  10. #10
    Forum Contributor
    Join Date
    06-25-2012
    Location
    Porto, Portugal
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Set a Trial Period For Use of Your Project

    @event21,
    Works like a charm... only one question though... The macro that i opened the topic was chosen because when the Log file was created and the file expires, then i knew where to find the file and delete it if i want the file to open again (without disabling macros on excel). But in Registry where this macro you provided creates the KEY so i can delete it if need too?

    Moderator's Note: As per Forum Rule #12, don't quote whole posts unless necessary-- it's just clutter...Thanks.
    Last edited by jeffreybrown; 12-15-2012 at 11:02 AM.

  11. #11
    Valued Forum Contributor
    Join Date
    11-15-2008
    Location
    ph
    MS-Off Ver
    2007/2010/2016
    Posts
    479

    Re: Set a Trial Period For Use of Your Project

    Hi -

    it is in
    HKEY_CURRENT_USER\Software\VB and VBA Program Settings

    Regards,
    Event

  12. #12
    Forum Contributor
    Join Date
    06-25-2012
    Location
    Porto, Portugal
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Set a Trial Period For Use of Your Project

    Found it to by using Search function Thank you very much. Really liked this approach. You solved my day. ;D

    Moderator's Note: As per Forum Rule #12, don't quote whole posts unless necessary-- it's just clutter...Thanks.
    Last edited by jeffreybrown; 12-15-2012 at 11:01 AM.

  13. #13
    Forum Contributor
    Join Date
    06-25-2012
    Location
    Porto, Portugal
    MS-Off Ver
    Excel 2010
    Posts
    201

    Re: Set a Trial Period For Use of Your Project

    Only now i see the Moderator's Note. Sorry for quote a lot. Didn't knew it us against the forum rules. At the time of the replies the moderators notes were not visible thats why i kept quoting. Never happen again. Sorry.

    Regards, Mário

  14. #14
    Registered User
    Join Date
    02-28-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Set a Trial Period For Use of Your Project

    There is one problem in this macro code, when system date is set to the earlier date it starts working, I just want if it is for 7 days from now. It work for only 7 days when system date is reset then file should close automatically. Can anyone help me for this?

  15. #15
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: Set a Trial Period For Use of Your Project

    Welcome to the Forum.

    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.
    Josie

    if at first you don't succeed try doing it the way your wife told you to

+ 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