With Xl & Access, and I assume most MS Office applications, holding down the "Shift" key when opening a file disables/stops any autoexec routine running.
Any idea how to disable the effect of the "shift key"?
I don't know how to disable the effect of the shift key, but if your goal is to prevent a user from disabling your Autpen or ThisWorkbook_Open event there is at least a way to force the user to both enable macros and to let the Open event run. This is simply to password protect and hide (I recommend setting the Visible property of the sheets to xlVeryHidden) all the worksheets in your workbook (save one blank sheet) and have your Open event unhide and unprotect them. Thus the workbook is unusable until the Open event runs. Of course the VBAProject must also be password protected so the user cannot see the code containing the password.
excellent suggestion, thanks Damon.
I do protect the sheets, but never thought of forcing the user to have macros enabled in this method. I'll give it a try.
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.