Retrieve XLS Padlock System ID from VBA


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


ReadSystemID = ""

End Function


You can then call the function:

Sub Test_ReadSystemID()

   MsgBox ReadSystemID()

End Sub


Copyright © 2021 G.D.G. Software