spell check for protected worksheet for Excel 97

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

So this code works for Excel 2003:
Sub Spell_Check()
ActiveSheet.Unprotect Password:="justme"
Cells.CheckSpelling SpellLang:=1033
ActiveSheet.Protect Password:="justme", DrawingObjects:=True, _
Contents:=True, Scenarios:=True
End Sub

However when I was trying to get it to work for someone, they were using an
older version of Excel (I believe it was 97), so how can I get the code to
work to get the spell check to work under protection? I kept getting error
messages such as:

"Can't execute code in break mode"

and

"Compile error: named argument not found" and then it highlights this part
of the code: SpellLang:=1033
 
The "can't execute..." message means that you tried to start the macro while it
(or another macro was still running). Not uncommon while you're debugging.

Hit Run|Reset on the VBE toolbar (there's a Reset icon on Standard toolbar
within the VBE that will do the Reset, too.)

And try dropping the "spelllang:=1033" portion.

It still worked for me in xl2003, but I don't have xl97 to test.
 
Back
Top