PDA

View Full Version : Setting Trial Period For Project



blinkme323
09-10-2008, 12:39 PM
Hi everyone,

I recently implemented the "set trial period for project" VB code that's on this site for some of my software at work. The code works great for my XP machines, but I keep getting a run-time error 75 on my Vista machines. I'm assuming that's just because the file paths are mapped differently in Vista.

I'm simply trying to hide the log file in the windows folder. The line of code I'm having a problem with is in red below:

Option Explicit

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# = 30 '< 30 days trial

'set your own obscure path and file-name
Const ObscurePath$ = "C:\Windows\"
Const ObscureFile$ = "TestFileLog.Log"
'*****************************************
Any help is greatly appreciated

blinkme323
09-10-2008, 07:50 PM
Any suggestions? I need this done by tomorrow.

Thanks!

mdmackillop
09-10-2008, 11:48 PM
Vista will not allow you to create files on the C root by code.

blinkme323
09-11-2008, 05:34 AM
"C:\users\public\" ended up working, it's not the ideal spot, but I'll take it for now. I'm guessing the registry would be the best place to hide it on Vista then.

Bob Phillips
09-11-2008, 05:59 AM
The registry is the best place for these things generally.