Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Aug 2001
    Location
    Surrey, United Kingdom
    Posts
    1,001
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ColourIndex propblem (2003 SP2)

    Morning all

    I have a workbook that works OK until I lock it. Part of the operation of the workbook is extended conditional formatting which is done by a Macro, when the workbook is unlocked it works without exception, when it is locked however I get the following bug in the code and the error message below. The cells that are set for the conditional formatting are unlocked.

    Any ideas Please

    Cheers

    Steve

    Case Else
    <span style="background-color: #FFFF00; color: #000000; font-weight: bold"> cel.Font.ColorIndex = 1</span hi>
    End Select
    End If
    Next cel
    End Sub
    Attached Images Attached Images
    Cheers

    Steve

    Asking the questions everbody wants the answers too but feels too stupid to ask themselves :-)

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: ColourIndex propblem (2003 SP2)

    It sounds to me like whatever is being referenced by the variable "cel" at this point in the code is not unprotected.

    Steve

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: ColourIndex propblem (2003 SP2)

    You should either specify that it is allowed to format cells in the Protect Sheet dialog, or unprotect the sheet in your code before modifying the formatting, and protect it again afterwards.

Posting Permissions

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