+ Reply to Thread
Results 1 to 3 of 3

Spellcheck Macro in Protected Worksheet - allowing 'Edit Objects'

  1. #1
    Registered User
    Join Date
    12-16-2012
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2007
    Posts
    19

    Spellcheck Macro in Protected Worksheet - allowing 'Edit Objects'

    Hi,
    I am using a spellcheck Macro in a protected worksheet. It works fine, but I need to modify it to check the 'edit objects' box when it protects the sheet after completing the spellcheck. I have tried a number of different things but it keeps coming back with an error. Can someone please help with this?

    Regards,
    Benn

    This is the code I already have;

    Sub SelectUnlockedCells_Spellcheck()

    ActiveSheet.Unprotect Password:="password"
    Dim WorkRange As Range
    Dim FoundCells As Range
    Dim Cell As Range
    Set WorkRange = ActiveSheet.UsedRange
    For Each Cell In WorkRange
    If Cell.Locked = False Then
    If FoundCells Is Nothing Then
    Set FoundCells = Cell
    Else
    Set FoundCells = Union(FoundCells, Cell)
    End If
    End If
    Next Cell
    If FoundCells Is Nothing Then
    MsgBox "All cells are locked."
    Else
    FoundCells.CheckSpelling CustomDictionary:="CUSTOM.DIC", _
    IgnoreUppercase:=False, AlwaysSuggest:=True, SpellLang:=3081
    End If

    ActiveSheet.Protect Password:="password"

    End Sub

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Spellcheck Macro in Protected Worksheet - allowing 'Edit Objects'

    Try this...

    ActiveSheet.Protect Password:="password", DrawingObjects:=False

  3. #3
    Registered User
    Join Date
    12-16-2012
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2007
    Posts
    19

    Re: Spellcheck Macro in Protected Worksheet - allowing 'Edit Objects'

    Hi AlphaFrog,
    That worked perfectly! Thank you very much for that. I was going around in circles and sucha simple fix.

    Regards,
    Benn

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1