Hiding/Protecting Specific Code in VBAProject

prestonosivad

New Member
Joined
Jun 17, 2016
Messages
1
Hey team -- Long time fan of Mr. Excel, but this is my first post and I hope that you can help me out!

The code written helps me to determine if my students are sharing excel templates in order to submit less-than-honorably-produced assignments.

I created some code to automatically log the usernames of those that open and edit the workbook on a "xlVeryHidden" sheet named "Log". I have written the code directly in the VBAProject (filename.xlsm)>Microsoft Excel Objects>ThisWorkbook

**THE QUESTION: Is there a way to specifically hide/password protect JUST this code (or JUST the "ThisWorkbook" object)? My class involves VBA projects, and requires the students to be able to create new modules.
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Hi and welcome to the board .

Unfortunately, you can't protect part of a vbproject

Have you considered placing the code in the Personal workbook or in an addin which you can protect seperately ? (this would work if the workbook is always opened from the same pc where the Excel application is installed)

Another workaround is to have an intermediary workbook that would open the target workbook , update the log sheet and close itself
 
Upvote 0

Forum statistics

Threads
1,223,234
Messages
6,170,891
Members
452,366
Latest member
TePunaBloke

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