Access to VBA Template

MarkoD
NewLounger
Posts: 2
Joined: 06 Nov 2020, 02:42

Access to VBA Template

Post by MarkoD »

Recently, after few years, having bit more time today, I started brushing off my VBA programming skills. :clapping:

I created VBA template which I am sharing with few users, and access is granted via VLookup from the UserList according to their phone number.
If user is not found, template displays message box and it closes.

Now, I would like to prevent access into VBA editor but still keep the access to template for validated users.

Any ideas on how to accomplish?
Especially the way to overcome CTRL + open, which I found lets you in the template and, in the VBA editor.

Thank you very much.

User avatar
HansV
Administrator
Posts: 78241
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Access to VBA Template

Post by HansV »

Welcome to Eileen's Lounge!

In the Visual Basic Editor, select Tools > <name> Properties... (<name> depends on the name of your database).
Activate the Protection tab.
Tick the 'Lock project for viewing' check box.
Enter a password in the Password box, and enter it again in the box below. Don't forget the password!
Click OK.

Next time the database is opened, the VBA code will still work normally, but users won't be able to view or edit the code unless you give them the password.

S0008.png
You do not have the required permissions to view the files attached to this post.
Best wishes,
Hans

MarkoD
NewLounger
Posts: 2
Joined: 06 Nov 2020, 02:42

Re: Access to VBA Template

Post by MarkoD »

Thank you very much HansV, will try it.