Purpose: retrieve number of remaining days in trial with VBA
The following VBA code lets you retrieve the number of remaining days for a trial workbook. It will also work for non-trial keys if your key has an expiration date or number of runs.
Public Function ReadTrialState()
Dim XLSPadlock As Object
On Error GoTo Err
Set XLSPadlock = Application.COMAddIns("GXLSForm.GXLSFormula").Object
ReadTrialState = XLSPadlock.PLEvalVar("TrialState")
ReadTrialState = ""
You can then call the function:
rdays = ReadTrialState()
Worksheets("Sheet1").Range("A1").Value = rdays
Copyright © 2022 G.D.G. Software