ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Protected worksheet and macro (https://www.excelbanter.com/excel-programming/281019-protected-worksheet-macro.html)

Massimiliano Alberti

Protected worksheet and macro
 
I have a protected worksheet with some macros I'm creating. The macros
call the
Protect Userinterfaceonly:=True to be able to modify the sheet, but
there are still some problems:

- I can't read/duplicate Hidden formulas (I had to disable the Hidden
attribute) (something like Range1.Formula = Range2.Formula doesn't
work if Range2 is hidden)

- Much more important: macros can't manipulate Shapes. I can't
duplicate and delete shapes (I use many formcontrols, and I use macros
to add and delete them)

What can I do? I don't want to put the password of the sheet in the
macro. (like Unprotect password:="topsecret")

--- Bye

Jim Rech

Protected worksheet and macro
 
Userinterfaceonly has many gaps I'm afraid. When you hit on one I think you
have to turn protection off.

I don't want to put the password of the sheet in the macro.


Why not? If you lock the project (Tools, Properties, Protection) in the
VBE) most users will not be able to see the password. VBE project protect
is stronger than sheet protection anyway. It's very easy to unlock a sheet.


--
Jim Rech
Excel MVP




All times are GMT +1. The time now is 12:01 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com