Consulting

Results 1 to 8 of 8

Thread: Solved: Determine if file is run remotely?

  1. #1
    VBAX Regular
    Joined
    Oct 2010
    Posts
    85
    Location

    Solved: Determine if file is run remotely?

    I have no locking schemes for my files. While I investigated a few solutions, they were too cumbersome.

    That said, my approach is to distribute the unlocked file to the company, without any protection from unauthorized distribution. I will offer the company a trial version, but they must delete the file after a certain amount of time.

    Is there any way to determine if they launch the file after the allowable time limit?

  2. #2
    VBAX Regular
    Joined
    Jun 2010
    Location
    Dunstable
    Posts
    44
    Location
    My initial thoughts would be to hide allt he worksheets on workbook close, leaving only a placeholder sheet with a message saying, "You must enable macros to view this workbook" on it.

    So when someone opens the workbook, this is all they get until they enable macros.

    In Workbook.Open, put something like If Cell in Veryhidden worksheet is blank, then write Now, otherwise if Now > 3Days from value in Cell, then show amessage box and then workbook.close, false.

    That should do the job. Easy to code as well.

    Rob.

  3. #3
    VBAX Mentor
    Joined
    Apr 2009
    Location
    Kingsbury
    Posts
    423
    Location

  4. #4
    VBAX Regular
    Joined
    Oct 2010
    Posts
    85
    Location
    Thanks!

    Both ways will work. In my case, I just need a hard date so I can do with simply with comparing the DATE or NOW variable with the current time.

    But the article by Rob is great because it starts the trial once the user opens it. Either way, these are both good options.

  5. #5
    Hi,

    I tried kb given above. I got following error: -

    Path/File access error (Error 75)

    at following line: -

    Open ObscurePath & ObscureFile For Output As #1


    How can I resolve this?

  6. #6
    VBAX Mentor
    Joined
    Apr 2009
    Location
    Kingsbury
    Posts
    423
    Location
    make sure this is valid

    Const ObscurePath$ = "C:\Program Files\MyFiles\"
    Const ObscureFile$ = "MyName_DLL"

    NB I put the underscore so that anybody wont be looking for a DLL file to mess with.

  7. #7
    Should I add any Reference in VBE?

  8. #8
    VBAX Expert shrivallabha's Avatar
    Joined
    Jan 2010
    Location
    Mumbai
    Posts
    750
    Location

    A Different Approach - Maybe Useful!

    The thread is "SOLVED" but perhaps, it will be useful if someone came in searching for another alternative. Probably, it is simpler:
    http://j-walk.com/ss/excel/tips/tip60.htm
    Regards,
    --------------------------------------------------------------------------------------------------------
    Shrivallabha
    --------------------------------------------------------------------------------------------------------
    Using Excel 2016 in Home / 2010 in Office
    --------------------------------------------------------------------------------------------------------

Posting Permissions

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