Excel sheet protection and VBA code
Does anyone know how to get Excel to allow VBA code to write to a password protected worksheet?
I am using a work-around solution at the moment whereby the VBA unprotects the relevant worksheet, writes data to it, then re-protects it.
There must be a better way than this though. Obviously I don't want my users to delete the formulas etc in the worksheet but I want my code to be able to write data to the worksheet without having to unprotect/re-protect it all the time!
Thanks
-Rob
Re: Excel sheet protection and VBA code
I think the only way is to do as you are. You could possibly add a new sheet as the "Display" sheet and have it linked to your
actual sheet. I think the protected "Dsiplay" sheet will still update as you change the "hidden" sheet.
Re: Excel sheet protection and VBA code
I used the method unprotect/protect in a excel-file, it works fine.
For each entry the code starts off with unprotecting and at the end it protects the file again. I had no problem with that.
Why don't you leave the cells that unprotected where user entries are allowed?
If your formulas are not in those cells, nothing can happen!