Issue with UnProtect userinterfaceonly:=true

R

robs3131

Hi all,

I have a file that has 65 sheets -- I would like to protect them all, but
not have to unprotect and then protect again each time I have code run to
change a given sheet. I was under the impression that "UnProtect
userinterfaceonly:=true" allows code to change a sheet without needing to
reprotect it. When I tried using this on a sheet that was protected (my line
of code is below), I get the good old Run-time error '1004 error. Any idea
on why this is not working? Thanks for your help!

Error:
Run-time error '1004': Application-defined or object defined error

Code:
Sheets("Transaction Summary").Unprotect userinterfaceonly:=True
 
J

Jim Rech

userinterfaceonly is a parameter of the Protect method, not Unprotect.

--
Jim
| Hi all,
|
| I have a file that has 65 sheets -- I would like to protect them all, but
| not have to unprotect and then protect again each time I have code run to
| change a given sheet. I was under the impression that "UnProtect
| userinterfaceonly:=true" allows code to change a sheet without needing to
| reprotect it. When I tried using this on a sheet that was protected (my
line
| of code is below), I get the good old Run-time error '1004 error. Any
idea
| on why this is not working? Thanks for your help!
|
| Error:
| Run-time error '1004': Application-defined or object defined error
|
| Code:
| Sheets("Transaction Summary").Unprotect userinterfaceonly:=True
|
| --
| Robert
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top