XLS Padlock Guide
XLS Padlock Guide

Determine if Current Activation Key Has an Expiration Date or Usage Limits

 

 

Purpose: determine if the activation key has an expiration date, number of days or runs

The following VBA code lets you will help you determine whether your current trial key has an expiration date or is limited by the number of days or runs.

Public Function ReadKeyExpState() 
Dim XLSPadlock As Object 
On Error GoTo Err 
Set XLSPadlock = Application.COMAddIns("GXLSForm.GXLSFormula").Object 
ReadKeyExpState = XLSPadlock.PLEvalVar("KeyExpState") 
Exit Function 
Err: 
ReadKeyExpState = "" 
End Function

You can then call the function:

Sub Test_Trial()
 rdays = ReadKeyExpState()  
 Worksheets("Sheet1").Range("A1").Value = rdays
End Sub

 

Possible values:

 

0: unavailable.

1: key with expiration date.

2: key with a given number of runs.

3: key with a given number of days.

 

ℹ You can retrieve the number of runs or days here.