Hi all,
From what I've seen online so far, there is no workaround for my problem, so this is my final desperate attempt to find an answer.
Over the past three months, I have been building a database in Excel. It is very complex and extensive at this point. I've put in various layers of simple protection, like password-protecting the individual worksheets, protecting the VBA project code, hiding all inactive sheets automatically, and building a login userform with different levels of access. Everything works very nicely, and I'm pleased with how it has turned out.
It occurred to me yesterday that I should probably find a way to prevent users from adding new worksheets to the database. This is mainly because it would seriously jack up the login code if they did add one. There aren't any people in my workplace who would deliberately try to mess things up, but there are plenty of people here who would mess things up accidentally, and I figured preventing worksheet additions would be another ounce of idiot-proofing.
Here's the problem: if I set up the basic Workbook.Protect method in the Workbook Open event, a whole ton of other code gets messed up. For example, every time the VBA tries to unhide or hide a sheet, the code crashes. Yes, I could go through and lift the workbook protection whenever a sheet needs to be hidden or un-hidden, but we are talking thousands of lines of code, and it would take me a million years, and I'd probably miss a few points where I should have added it and then the code will crash on a user, which is a very bad thing.
Is there any way to set up Workbook Protect so it protects from user interface only? I know I can protect the worksheets this way. This would be a lovely workaround for me. However, from what I've seen online, this isn't possible. PLEASE tell me there is a workaround! I really don't want to have to sit down and go through all the work of protecting and unprotecting on each macro, and I also really don't want users to be able to accidentally add worksheets. For heaven's sake, I accidentally added one the other day! I deleted it immediately, but you can't assume that a user would be sensible enough to do that.
If there isn't a workaround, I'll go through and add the protection and unprotection everywhere. But it would be nice if one of you could save me from that.
Bookmarks