Access to registration information from VBA macro.

Excel File Compiler Screenshot

LockXLS allows to get registration information about locked workbook using VBA macro. For example this code shows, was Activation Code entered, or not:

' declare variable for LockXLS Runtime object
Dim oLockXLS As Object
' create LockXLS Runtime object
Set oLockXLS = CreateObject("LockXLSRuntime.Connect")
' display True or False using MsgBox
MsgBox oLockXLS.GetActivationInfo (ThisWorkbook, "registered")
' release LockXLS Runtime object
Set oLockXLS = Nothing

Method LockXLSRuntime.GetActivationInfo( <workbook>, <option> ) may receive the following options:

This method returns information only for workbooks protected with Activation Code or with Serial Number protection options.

Method LockXLSRuntime.IsWorkbookActivated( <workbook> ) returns True if this workbook has been successfully activated. This is same function as GetActivationInfo with "registered" option.

Method LockXLSRuntime.IsWorkbookLocked( <workbook> ) returns True if this workbook object represents workbook protected with LockXLS. You can use this method to distinguish locked and unlocked versions of your workbooks.

Method LockXLSRuntime.GetComputerCode( <options> ) returns Computer Code for this PC. Possible such values for options:

You can use any of these values or combination of them. For example, GetComputerCode(1 + 2) returns Computer Code generated for CPU and HDD only.

You can use this technique to limit functinality of your workbook during trial period. If GetActivationInfo function with registered option returns FALSE - you workbook is in trial period.

This example shows how to access Serial Number and Customer ID:

' declare variable for LockXLS Runtime object
Dim oLockXLS As Object
' create LockXLS Runtime object
Set oLockXLS = CreateObject("LockXLSRuntime.Connect")
' display Serial Number and Customer ID
Sheets("Sheet1").Range("K3") = oLockXLS.GetActivationInfo(ThisWorkbook, "customer_id")
Sheets("Sheet1").Range("K4") = oLockXLS.GetActivationInfo(ThisWorkbook, "serial_number")
' release LockXLS Runtime object
Set oLockXLS = Nothing

See Also

All methods of the LockXLS Runtime object

Review Runtime Functions example which shows usage of these macros