A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Spell Check



 
 
Thread Tools Display Modes
  #1  
Old June 15th, 2009, 09:22 AM posted to microsoft.public.excel.worksheet.functions
Warm
external usenet poster
 
Posts: 6
Default Spell Check

Hi,

can someone please explain why this proction macro does not allow the spell
check function to work when the 'userinterfaceonly' option is in it?!

Sub ProtectAll()

Dim sPassword As String
sPassword = "LMW5487"

If Application.InputBox( _
Prompt:="Please enter the password", _
Title:="Password", _
Type:=2) sPassword Then

MsgBox "Wrong password!"
Exit Sub

End If

Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
ws.Protect Password:="sPassword", AllowFormattingCells:=True, _
Contents:=True, Scenarios:=True, userinterfaceonly:=True

Next ws

End Sub
--
Warm
  #2  
Old June 15th, 2009, 09:32 AM posted to microsoft.public.excel.worksheet.functions
Mike H
external usenet poster
 
Posts: 8,419
Default Spell Check

Hi,

using userinterfaceonly simply means that you can change a protected sheet
using VB and if you want to spell check using code you can but won't be able
to do it from the worksheet menu.

To check using code do something like

Cells.CheckSpelling SpellLang:=1033

Mike

"Warm" wrote:

Hi,

can someone please explain why this proction macro does not allow the spell
check function to work when the 'userinterfaceonly' option is in it?!

Sub ProtectAll()

Dim sPassword As String
sPassword = "LMW5487"

If Application.InputBox( _
Prompt:="Please enter the password", _
Title:="Password", _
Type:=2) sPassword Then

MsgBox "Wrong password!"
Exit Sub

End If

Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
ws.Protect Password:="sPassword", AllowFormattingCells:=True, _
Contents:=True, Scenarios:=True, userinterfaceonly:=True

Next ws

End Sub
--
Warm

  #3  
Old June 15th, 2009, 12:08 PM posted to microsoft.public.excel.worksheet.functions
Warm
external usenet poster
 
Posts: 6
Default Spell Check

Hi,
it still does not check the spelling, is there any particular place i need
to add it in?
--
Warm


"Mike H" wrote:

Hi,

using userinterfaceonly simply means that you can change a protected sheet
using VB and if you want to spell check using code you can but won't be able
to do it from the worksheet menu.

To check using code do something like

Cells.CheckSpelling SpellLang:=1033

Mike

"Warm" wrote:

Hi,

can someone please explain why this proction macro does not allow the spell
check function to work when the 'userinterfaceonly' option is in it?!

Sub ProtectAll()

Dim sPassword As String
sPassword = "LMW5487"

If Application.InputBox( _
Prompt:="Please enter the password", _
Title:="Password", _
Type:=2) sPassword Then

MsgBox "Wrong password!"
Exit Sub

End If

Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
ws.Protect Password:="sPassword", AllowFormattingCells:=True, _
Contents:=True, Scenarios:=True, userinterfaceonly:=True

Next ws

End Sub
--
Warm

  #4  
Old June 16th, 2009, 03:30 PM posted to microsoft.public.excel.worksheet.functions
Gord Dibben
external usenet poster
 
Posts: 20,252
Default Spell Check

Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
ws.Protect Password:="sPassword", AllowFormattingCells:=True, _
Contents:=True, Scenarios:=True, userinterfaceonly:=True
Cells.CheckSpelling SpellLang:=1033

Next ws



Gord Dibben MS Excel MVP


On Mon, 15 Jun 2009 04:08:04 -0700, Warm
wrote:

Hi,
it still does not check the spelling, is there any particular place i need
to add it in?


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:31 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.