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.
 

Some videos you may like

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

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
 

Watch MrExcel Video

Forum statistics

Threads
1,122,186
Messages
5,594,738
Members
413,929
Latest member
Hypatia

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