How to create/generate a licence code for my excel file

bhandari

Active Member
Joined
Oct 17, 2017
Messages
359
can i get a macro for create/generate a licence code for my excel file?
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
i mean i want to sell my spreadsheet to users
Depending on activation
i want to give a Activation key to access them
which will expire sometimes later and will ask to renew the licence?
 
Upvote 0
.
The following macro is not the entire code needed for your project BUT it is a start for you.

There is a 'hard coded' expiration date in the macro. After that date, the program becomes 'Read Only' and requires a password to unprotect the sheets.

You will need to develop a means of issuing a new password each time the workbook becomes disabled. You will also need to protect the code so the user can not
gain access to it and then bypass your password measures.

Protecting the code from the user is always the hard part. Excel is not designed to be impenetrable. There is always a means to access the code if the user is determined.

You might consider purchasing a commercial product that turns your workbook into a stand alone executable. Search the internet for " Excel To EXE ". There are several good
products that will provide all the functionality you seek (password protection, timed usage, code protection, etc.). Making the workbook into an executable makes it ALOT harder
for someone to crack ... but even then, if they know how - they will.

Code:
Option Explicit




Sub Workbook_Open() '<----goes in ThisWorkBook
 On Error Resume Next
 Dim Edate As Date
 Dim sh As Worksheet
Edate = Format("30/11/2016", "DD/MM/YYYY")
     If Date > Edate Then
         MsgBox ("This Workbook was valid up to " & Format(Edate, "dd-mmm-yyyy")) & vbNewLine & _
         ("It is now a Read Only Document"), vbExclamation, "Tools"
For Each sh In Worksheets
     With sh


        .Unprotect Password:="password"
        .Cells.Locked = True
        .Range("A:XFD").Locked = True
        
        Run "deleteButtons", sh
        Run "deleteHover", sh
        .Protect Password:="password"
      
    End With
Next
ActiveWorkbook.Save


End If
End Sub
 
Upvote 0
I have 3rd party tool to protect my macro they cant break,they are not providing Licence Key to user depend on activation..
I brought Unviewable Secure++
 
Upvote 0
.
You should have everything you need in that package. I reviewed a video that describes what the product does. Seems like the level of code protection is about as secure
as you can get without turning your workbook in to a stand alone executable.

By implementing a macro that contains a number of different passwords (one for each year ?) would be one way of protecting your project.
Consider the possibility of using a CASE SELECT structure.

There are other ways as well. Perhaps someone else has an idea they will share.
 
Upvote 0

Forum statistics

Threads
1,216,175
Messages
6,129,312
Members
449,500
Latest member
Jacky Son

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top