sharing and protecting incompatible?

  • Thread starter Thread starter puba1967
  • Start date Start date
P

puba1967

Hi,
I'd like to share a workbook made of 3 sheets.
However, I'd like to protect one of the sheets as its content is made
up via macros with the data from the first two sheets.
Unfortunately, the macro will return an error message:

"Unprotect method of Worksheet class failed"
Run-time error '1004'

The macro begins with the following code:
Sheets("Database").Select
ActiveSheet.Unprotect

If I don't share the workbook, the macro works fine.

Is it possible for the macro to unprotect the workbook in order to
perform the data handling?
 
Changing the protection of a worksheet in a shared workbook is not allowed.

But this is documented in Excel's help.
Look for: Features that are unavailable in shared workbooks for a big list.
 
A colleague gave me the solution:
The worksheet was protected to prevent writing, but needed unprotection
to do a "find and replace".
Solution, unlock the relevant column for the "find and replace",
therefore, the macro doesn't need to unprotect the entire sheet. All
columns are protected but that one.

case closed
:-)

PUBA
 
Back
Top