Results 1 to 3 of 3

Thread: [RESOLVED] Changing Object Fill Color

  1. #1

    Thread Starter
    Member
    Join Date
    Apr 2014
    Posts
    32

    Resolved [RESOLVED] Changing Object Fill Color

    Hello .. Can someone help me in this please?
    I have more than 180 circles shape inserted in a worksheet. I need to change the filling color of specific circle once a condition is true.
    I got “Run-time error '438' - Object doesn't support this property or method” with the below code:
    Code:
        
    With Worksheets(Sheet2.Name).Shapes.Range(Array("Oval 52")).ShapeRange.Fill
            .Visible = msoTrue
            .ForeColor.RGB = RGB(112, 48, 160)
            .Transparency = 0
            .Solid
    End With

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Changing Object Fill Color

    you can try like
    Code:
    With Worksheets(Sheet2.Name).Shapes("Oval 52")
            .Visible = msoTrue
            .Fill.ForeColor.RGB = RGB(112, 48, 160)
            .Shadow.Transparency = 0
    End With
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  3. #3

    Thread Starter
    Member
    Join Date
    Apr 2014
    Posts
    32

    Re: [RESOLVED] Changing Object Fill Color

    Thanks a lot. Your way is working perfectly

Posting Permissions

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



Click Here to Expand Forum to Full Width