ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Licence Verification (https://www.excelbanter.com/excel-programming/324280-licence-verification.html)

alanford

Licence Verification
 
I have built a module to ensure that my managers follow the correct
procedure for their risk assessment, now the company has shown an
interest in my work, however I would like to limit the access to the
program in the following manner if possible.
During install I can input a string in LOCALMACHINE as a licence number
I need to build a workbook called main.xls wich will run once after
intall with a inputbox which will look into localmachine and read the
string, after verification that the string matches it will rename
itself as main.old and rename another file main2.xls as main.xls. if
the string does not match a msgbox would prompt the user to contact me
to obtain a installable version of the program with a valid licence. I
hope this makes sence. thank you for your help.

Alan


David

Licence Verification
 
I thought we all did this for free? Actually I found this interesting and
would like to read any answers you get.
Thanks

"alanford" wrote:

I have built a module to ensure that my managers follow the correct
procedure for their risk assessment, now the company has shown an
interest in my work, however I would like to limit the access to the
program in the following manner if possible.
During install I can input a string in LOCALMACHINE as a licence number
I need to build a workbook called main.xls wich will run once after
intall with a inputbox which will look into localmachine and read the
string, after verification that the string matches it will rename
itself as main.old and rename another file main2.xls as main.xls. if
the string does not match a msgbox would prompt the user to contact me
to obtain a installable version of the program with a valid licence. I
hope this makes sence. thank you for your help.

Alan



Bob Phillips[_6_]

Licence Verification
 
Don't know about all the pfaffing about with the main.xls, and not really
understanding how you would validate the licence value, but you could put
this in the workbook open event (ThisWorkbook code module). It checks
whether there is a licence key, so just change the registry key to suit.

Private Sub Workbook_Open()
Dim oWSH As Object
Dim sResult

Set oWSH = CreateObject("WScript.Shell")

On Error Resume Next
'Read language registry key information
sResult = oWSH.RegRead("HKLM\Software\Alan\myApp\Licence\")
If Err.Number < 0 Or sResult = "" Then
MsgBox "No valid licence" & vbCrLf & _
"Contact Alan for a valid version"
Me.Close savechanges:=False
End If
Err.Clear

On Error GoTo 0

End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"alanford" wrote in message
oups.com...
I have built a module to ensure that my managers follow the correct
procedure for their risk assessment, now the company has shown an
interest in my work, however I would like to limit the access to the
program in the following manner if possible.
During install I can input a string in LOCALMACHINE as a licence number
I need to build a workbook called main.xls wich will run once after
intall with a inputbox which will look into localmachine and read the
string, after verification that the string matches it will rename
itself as main.old and rename another file main2.xls as main.xls. if
the string does not match a msgbox would prompt the user to contact me
to obtain a installable version of the program with a valid licence. I
hope this makes sence. thank you for your help.

Alan




RB Smissaert

Licence Verification
 
oWSH.RegRead

Interesting, first time I have seen this. Any reason why you prefer this
above
reading the registry with the Windows API?

RBS


"Bob Phillips" wrote in message
...
Don't know about all the pfaffing about with the main.xls, and not really
understanding how you would validate the licence value, but you could put
this in the workbook open event (ThisWorkbook code module). It checks
whether there is a licence key, so just change the registry key to suit.

Private Sub Workbook_Open()
Dim oWSH As Object
Dim sResult

Set oWSH = CreateObject("WScript.Shell")

On Error Resume Next
'Read language registry key information
sResult = oWSH.RegRead("HKLM\Software\Alan\myApp\Licence\")
If Err.Number < 0 Or sResult = "" Then
MsgBox "No valid licence" & vbCrLf & _
"Contact Alan for a valid version"
Me.Close savechanges:=False
End If
Err.Clear

On Error GoTo 0

End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"alanford" wrote in message
oups.com...
I have built a module to ensure that my managers follow the correct
procedure for their risk assessment, now the company has shown an
interest in my work, however I would like to limit the access to the
program in the following manner if possible.
During install I can input a string in LOCALMACHINE as a licence number
I need to build a workbook called main.xls wich will run once after
intall with a inputbox which will look into localmachine and read the
string, after verification that the string matches it will rename
itself as main.old and rename another file main2.xls as main.xls. if
the string does not match a msgbox would prompt the user to contact me
to obtain a installable version of the program with a valid licence. I
hope this makes sence. thank you for your help.

Alan





Bob Phillips[_6_]

Licence Verification
 
Brevity of code.

In my production stuff I use the APIs, in case there is a downer on
installing WSH.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"RB Smissaert" wrote in message
...
oWSH.RegRead


Interesting, first time I have seen this. Any reason why you prefer this
above
reading the registry with the Windows API?

RBS


"Bob Phillips" wrote in message
...
Don't know about all the pfaffing about with the main.xls, and not

really
understanding how you would validate the licence value, but you could

put
this in the workbook open event (ThisWorkbook code module). It checks
whether there is a licence key, so just change the registry key to suit.

Private Sub Workbook_Open()
Dim oWSH As Object
Dim sResult

Set oWSH = CreateObject("WScript.Shell")

On Error Resume Next
'Read language registry key information
sResult = oWSH.RegRead("HKLM\Software\Alan\myApp\Licence\")
If Err.Number < 0 Or sResult = "" Then
MsgBox "No valid licence" & vbCrLf & _
"Contact Alan for a valid version"
Me.Close savechanges:=False
End If
Err.Clear

On Error GoTo 0

End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"alanford" wrote in message
oups.com...
I have built a module to ensure that my managers follow the correct
procedure for their risk assessment, now the company has shown an
interest in my work, however I would like to limit the access to the
program in the following manner if possible.
During install I can input a string in LOCALMACHINE as a licence number
I need to build a workbook called main.xls wich will run once after
intall with a inputbox which will look into localmachine and read the
string, after verification that the string matches it will rename
itself as main.old and rename another file main2.xls as main.xls. if
the string does not match a msgbox would prompt the user to contact me
to obtain a installable version of the program with a valid licence. I
hope this makes sence. thank you for your help.

Alan







alanford

Licence Verification
 
Thank you I have achieved what I set out to do, but only thank to you.
this is a breakthrough for me I'll never thank you enough.

Brilliant.

Alan


alanford

Licence Verification
 
David
this is going to be for free as I have developed this for my company
but I just want to avoid people copying my work and distributing it as
theirs. Now that annoys me immensly.

Alan



All times are GMT +1. The time now is 10:31 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com