Purpose: test if online validation was successful or not

XLS Padlock supports online validation of activation keys. You can decide what to do if validation fails.

Use the following function to get the result of the validation process:

Public Function IsValidationOK()
Dim XLSPadlock As Object
On Error GoTo Err
Set XLSPadlock = Application.COMAddIns("GXLSForm.GXLSFormula").Object
If XLSPadlock.PLEvalVar("ValidationSuccess") = "1" Then
 IsValidationOK = True
Else
 IsValidationOK = False
End If
Exit Function
Err:
IsValidationOK = False
End Function
 

 

You can then call the function. For instance, the following code sets the value of a cell:

Private Sub Workbook_Open()
If IsValidationOK Then
Sheet1.Range("S24") = "OK"
Else
Sheet1.Range("S24") = "FAIL"
End If
End Sub