Purpose: retrieve XLS Padlock System ID from VBA

XLS Padlock lets you use hardware-locking to secure your workbook. This is based on a unique system ID, see “Use hardware-locked keys”.

If you want to retrieve the value of the system ID with VBA code, use the following one:

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

 

You can then call the function:

Sub Test_ReadSystemID()
   MsgBox ReadSystemID()
End Sub