Lock VBA code from Viewing

hernandj

Board Regular
Joined
Aug 19, 2004
Messages
60
I am trying to lock my VBA code from viewing and changing. I also have an autosave routine that saves the workbook after the user exits. Apparently, they conflict with each other because If I lock the code, the autosave does not work. I get an error message saying that the file can not be saved.

Is there any other way to lock the VBA Code?

Thanks in advance for your consideration.
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

hernandj

Board Regular
Joined
Aug 19, 2004
Messages
60
Thanks for the response. That is the procedure I used and it works. The problem is that it conflicts with a autosave routine that is part of the VBA. When the autosave procedure runs, it can not save the backup copy. The autosave saves a copy of the workbook for the user in a folder called ExcelBackup. This is in addition to the original workbook.

I was hoping that there would be a way for me to accomplish both missions.

Thanks again for the effort
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,164,156
Messages
5,835,702
Members
430,380
Latest member
Psalmysam

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
Top