I created an Excel-based POS system. To protect it from being pirated, I put an Activate button that runs a macro that gets the motherboard's serial number and stores it in a cell somewhere in a worksheet. You do this one-time when you install the software in a client's computer (licensed machine).
Then I wrote an event procedure in ThisWorkbook that would get the computer's motherboard's serial number and compare it with the one stored earlier for the licensed machine. If the software was copied and used in another machine, of course there will be no match. The user will be notified by a message that says, "You have installed the program in another computer. For a licensed version, pls. contact blah blah..." When the user clicks the OK button, the workbook will close. The project is locked for viewing.
Thus, once the workbook is locked into the licensed machine and it is copied and used in another computer, the user won't be able to open the workbook.
Is there a way for hackers to get past my security procedure? If so how and how can I stop them? What other ways can I do to prevent others from pirating my software? Thanks.
Here is the code:
Private Sub Workbook_Open()
Dim LicensedMachine As String
LicensedMachine = Sheet1.Range("Z102") ''This is where you have already stored licensed machine's motherboard s.n.
If MBSerialNumber <> LicensedMachine Then ''Call function and check if current machine's motherboard s.n. matches the licensed machine's.
MsgBox Title:="EXCEL POS", Prompt:="You have installed program in another computer." & vbCrLf & _
"Contact R House at 0917-555-1234 or [email protected] for licensed copy.", _
Buttons:=vbExclamation
ActiveWorkbook.Save
ActiveWorkbook.Close
End If
End Sub