Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Spell Checking on a protected sheet

Hi,

I am using the following code for a spell cehcking control on a protected
sheet. I want to allow unlocked rows that have word wrap enabled to autofit
the contents of the unlocked rows.

Private Sub SpellCheck_Click()

ActiveSheet.Unprotect Password:="00000"
Cells.CheckSpelling _
CustomDictionary:="CUSTOM.DIC", _
IgnoreUppercase:=False, _
AlwaysSuggest:=True
ActiveSheet.Protect Password:="00000"
' Allow rows to be formatted (autofit) on a protected worksheet.
If ActiveSheet.Protection.AllowFormattingRows = False Then
ActiveSheet.Protect AllowFormattingRows:=True
End If

End Sub

This works except when this code runs and there is no spelling errors. Then,
it reprotects the sheet, but removes the password.

Any suggestions on how to fix this?

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Spell Checking on a protected sheet

Well, I still can't seem to get this to work, so I'm going to bump this up.

"mooresk257" wrote:

Hi,

I am using the following code for a spell cehcking control on a protected
sheet. I want to allow unlocked rows that have word wrap enabled to autofit
the contents of the unlocked rows.

Private Sub SpellCheck_Click()

ActiveSheet.Unprotect Password:="00000"
Cells.CheckSpelling _
CustomDictionary:="CUSTOM.DIC", _
IgnoreUppercase:=False, _
AlwaysSuggest:=True
ActiveSheet.Protect Password:="00000"
' Allow rows to be formatted (autofit) on a protected worksheet.
If ActiveSheet.Protection.AllowFormattingRows = False Then
ActiveSheet.Protect AllowFormattingRows:=True
End If

End Sub

This works except when this code runs and there is no spelling errors. Then,
it reprotects the sheet, but removes the password.

Any suggestions on how to fix this?

Thanks!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Spell Checking on a protected sheet

Bump

"mooresk257" wrote:

Hi,

I am using the following code for a spell cehcking control on a protected
sheet. I want to allow unlocked rows that have word wrap enabled to autofit
the contents of the unlocked rows.

Private Sub SpellCheck_Click()

ActiveSheet.Unprotect Password:="00000"
Cells.CheckSpelling _
CustomDictionary:="CUSTOM.DIC", _
IgnoreUppercase:=False, _
AlwaysSuggest:=True
ActiveSheet.Protect Password:="00000"
' Allow rows to be formatted (autofit) on a protected worksheet.
If ActiveSheet.Protection.AllowFormattingRows = False Then
ActiveSheet.Protect AllowFormattingRows:=True
End If

End Sub

This works except when this code runs and there is no spelling errors. Then,
it reprotects the sheet, but removes the password.

Any suggestions on how to fix this?

Thanks!

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default Spell Checking on a protected sheet

does changing the protection line make a difference?

Private Sub SpellCheck_Click()

ActiveSheet.Unprotect Password:="00000"
Cells.CheckSpelling _
CustomDictionary:="CUSTOM.DIC", _
IgnoreUppercase:=False, _
AlwaysSuggest:=True
' Allow rows to be formatted (autofit) on a protected worksheet.
If ActiveSheet.Protection.AllowFormattingRows = False Then
ActiveSheet.Protect AllowFormattingRows:=True
End If

ActiveSheet.Protect Password:="00000" ' <=== moved to here

End Sub


"mooresk257" wrote in message
...
Bump

"mooresk257" wrote:

Hi,

I am using the following code for a spell cehcking control on a protected
sheet. I want to allow unlocked rows that have word wrap enabled to
autofit
the contents of the unlocked rows.

Private Sub SpellCheck_Click()

ActiveSheet.Unprotect Password:="00000"
Cells.CheckSpelling _
CustomDictionary:="CUSTOM.DIC", _
IgnoreUppercase:=False, _
AlwaysSuggest:=True
ActiveSheet.Protect Password:="00000"
' Allow rows to be formatted (autofit) on a protected worksheet.
If ActiveSheet.Protection.AllowFormattingRows = False Then
ActiveSheet.Protect AllowFormattingRows:=True
End If

End Sub

This works except when this code runs and there is no spelling errors.
Then,
it reprotects the sheet, but removes the password.

Any suggestions on how to fix this?

Thanks!


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default Spell Checking on a protected sheet

does changing the protection line make a difference?

Private Sub SpellCheck_Click()

ActiveSheet.Unprotect Password:="00000"
Cells.CheckSpelling _
CustomDictionary:="CUSTOM.DIC", _
IgnoreUppercase:=False, _
AlwaysSuggest:=True
' Allow rows to be formatted (autofit) on a protected worksheet.
If ActiveSheet.Protection.AllowFormattingRows = False Then
ActiveSheet.Protect AllowFormattingRows:=True
End If

ActiveSheet.Protect Password:="00000" ' <=== moved to here

End Sub


"mooresk257" wrote in message
...
Bump

"mooresk257" wrote:

Hi,

I am using the following code for a spell cehcking control on a protected
sheet. I want to allow unlocked rows that have word wrap enabled to
autofit
the contents of the unlocked rows.

Private Sub SpellCheck_Click()

ActiveSheet.Unprotect Password:="00000"
Cells.CheckSpelling _
CustomDictionary:="CUSTOM.DIC", _
IgnoreUppercase:=False, _
AlwaysSuggest:=True
ActiveSheet.Protect Password:="00000"
' Allow rows to be formatted (autofit) on a protected worksheet.
If ActiveSheet.Protection.AllowFormattingRows = False Then
ActiveSheet.Protect AllowFormattingRows:=True
End If

End Sub

This works except when this code runs and there is no spelling errors.
Then,
it reprotects the sheet, but removes the password.

Any suggestions on how to fix this?

Thanks!




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 50
Default Spell Checking on a protected sheet

I've tried that. It mostly solvevs the issue of removing the password, but
then the row formatting doesn't work, i.e. AllowFormattingRows = False.

I need to be able to have the rows autofit to wrapped text, which won't
happen unless the row formatting is allowed. Otherwsie I'd take that part of
the code out.


"Patrick Molloy" wrote:

does changing the protection line make a difference?

Private Sub SpellCheck_Click()

ActiveSheet.Unprotect Password:="00000"
Cells.CheckSpelling _
CustomDictionary:="CUSTOM.DIC", _
IgnoreUppercase:=False, _
AlwaysSuggest:=True
' Allow rows to be formatted (autofit) on a protected worksheet.
If ActiveSheet.Protection.AllowFormattingRows = False Then
ActiveSheet.Protect AllowFormattingRows:=True
End If

ActiveSheet.Protect Password:="00000" ' <=== moved to here

End Sub


"mooresk257" wrote in message
...
Bump

"mooresk257" wrote:

Hi,

I am using the following code for a spell cehcking control on a protected
sheet. I want to allow unlocked rows that have word wrap enabled to
autofit
the contents of the unlocked rows.

Private Sub SpellCheck_Click()

ActiveSheet.Unprotect Password:="00000"
Cells.CheckSpelling _
CustomDictionary:="CUSTOM.DIC", _
IgnoreUppercase:=False, _
AlwaysSuggest:=True
ActiveSheet.Protect Password:="00000"
' Allow rows to be formatted (autofit) on a protected worksheet.
If ActiveSheet.Protection.AllowFormattingRows = False Then
ActiveSheet.Protect AllowFormattingRows:=True
End If

End Sub

This works except when this code runs and there is no spelling errors.
Then,
it reprotects the sheet, but removes the password.

Any suggestions on how to fix this?

Thanks!


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
spell check on protected sheet spell check on protected sheet Excel Discussion (Misc queries) 2 September 30th 08 04:45 PM
Spell checking a protected worksheet Trevor Excel Discussion (Misc queries) 0 February 14th 07 07:25 AM
Protected sheet spell check Liz Excel Discussion (Misc queries) 0 May 11th 06 05:05 PM
How can I use spell checking in a protected worksheet? Deb from MA Excel Worksheet Functions 1 April 24th 06 06:40 PM
Spell checking a protected sheet bjshots Excel Programming 0 June 16th 04 05:40 AM


All times are GMT +1. The time now is 08:45 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"