Skip to content

Instantly share code, notes, and snippets.

@ScottDeLuzio
Created February 18, 2016 21:12
Show Gist options
  • Save ScottDeLuzio/e4515bb8df897c7859e0 to your computer and use it in GitHub Desktop.
Save ScottDeLuzio/e4515bb8df897c7859e0 to your computer and use it in GitHub Desktop.
Software Licensing for Excel Add-In Check License on Startup
Private Sub Workbook_Open()
httpRequestCheck
With ThisWorkbook.Worksheets("Sheet1").Range("A1")
' the And .Cells(4, 1) = 0 is probably redundant, and if you are allowing more than one activation per license key you should remove that part.
If .Cells(3, 1).Value = "valid" And .Cells(4, 1) = 0 And .Cells(5, 1) <> "in_use" Then
'call your add-in here
Else
'if the license is not valid, the number of activations remaining is greater than 0, and it is not in use elsewhere we should display the license activation UserForm.
Activate_License
End If
End With
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment