Results 1 to 5 of 5

Run time error 438 for shape fill

Threaded View

  1. #1
    Registered User
    Join Date
    10-05-2011
    Location
    South Wales
    MS-Off Ver
    Excel 2007
    Posts
    2

    Run time error 438 for shape fill

    I have a long code that worked perfectly before. When I added some code regarding shape fill colour I had a runtime error 438. I removed this code and tested it on a seperate tab to see what the problem is but I still get the error. I have written code before to fill a shape a certain colour and never had this problem. I am really confused. Here is the simple code
    Private Sub CommandButton1_Click()
    If Range("L14").Text = "Red" Then
            ActiveSheet.Shapes("Oval 7").Select
            ActiveSheet.Shapes("Oval 7").Fill.ForeColor.RBG = RGB(255, 0, 0)
    ElseIf Range("L14").Text = "Amber" Then
            ActiveSheet.Shapes("Oval 7").Select
             ActiveSheet.Shapes("Oval 7").Fill.ForeColor.RBG = RGB(192, 80, 77)
    ElseIf Range("L14").Text = "Green" Then
            ActiveSheet.Shapes("Oval 7").Select
            ActiveSheet.Shapes("Oval 7").Fill.ForeColor.RBG = RGB(192, 80, 77)    
    End If
    End Sub
    If I enter Green into L14 the line error occurs at the line in bold. What am I doing wrong?
    Last edited by Lotty; 10-05-2011 at 07:50 AM. Reason: code tags

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