Changing of Cell protections after saving Excel File (2002)

  • Thread starter Thread starter Mike J
  • Start date Start date
M

Mike J

This problem occurs when I protect a document using a
macro 4.0 function: =PROTECT.DOCUMENT(TRUE,,,TRUE,TRUE).

When I use the function within a macro4.0 macro, on an
original file, everything works fine. The sheet has
unlocked cells, and when the sheet is protected, it
allows me to access those cells. But if I save the file,
or save.as another name, then the fun begins.

The enable selection of the sheet( view codes) has gone
from 0-xlNoRestrictions to -4142- xlNoSelection. This
locks me out of doing anything in the sheet. When I
unprotect and then re-protect the sheet using the
Tools:protection menu, when I re-protect it, the standard
check marks for select locked cells, select unlocked
cells, are MISSING.

IS THIS A BUG IN THE CODE REGARDING MACRO 4.0 function
PROTECT.DOCUMENT and the new protection function options
in Excel 2002? If so, How can I make it work? The macros
I use constantly protect and unprotect sheets.
I know Macro 4.0 very well, but Visual Basic for
Applications, I have little knowledge. But if there is a
fix utilizing Visual Basic, I'll take it.

Any suggestions, please let me know.
 
Well, I tried to reproduce your problem but I couldn't. Selection remains
no restrictions. If I can't repro it it's hard to come up with a
workaround. If you left anything out let me know.
 
I did forget one thing. The original file is fine. It's
in the new file that it is saved to. IE orignial file
xxx.xls then saved to file xxx1.xls. Now open up file
xxx1.xls, and the problem again begins.
 
Back
Top