+ Reply to Thread
Results 1 to 12 of 12

Problem setting transparency by VBA in XYScatter chart

  1. #1
    Registered User
    Join Date
    12-15-2013
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    6

    Problem setting transparency by VBA in XYScatter chart

    Using Excel 2010 and VBA, I experience a problem when I try to set the transparency of the fill of circular data points of a seriescollection in an XYScatter chart. As soon as the relevant code line is executed, the fill colour changes to olive green regardless of the colour it has been originally. I tried the same basic code line in a line chart and it operated correctly. I also tried the code in a completely new chart and the problem persisted.

    The relevant code line is
    Please Login or Register  to view this content.
    Any help?
    Does anybody know whether the same problem occurs when using Excel 2013?

    Thanks
    itbcvdw

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Problem setting transparency by VBA in XYScatter chart

    Does this work for you in xl2010?

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    12-15-2013
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Problem setting transparency by VBA in XYScatter chart

    Thanks, Andy.
    I tried your code with a new XYScatter chart, using only your code and nothing else, but the problem remains the same. The code functions correctly up to the instruction setting the ForeColor. When the next code line is executed, the ForeColor changes and the transparency does not change. It seems as if the ForeColor returns to the color that was used when the chart was created.

    Does it function correctly in Excel 2013?

    Cheers
    itbcvdw

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Problem setting transparency by VBA in XYScatter chart

    Don't you just hate it when you find out you already knew the answer but could not remember it

    Try this,
    http://www.andypope.info/tips/tip015.htm

  5. #5
    Registered User
    Join Date
    12-15-2013
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Problem setting transparency by VBA in XYScatter chart

    Thanks for your trouble, Andy, This works, but could become cumbersome because setting the transparency forms only part of a more complex process.

    Is the problem of setting in VBA of transparency in XYScatter charts solved in Excel 2013? If so, I could upgrade.

    Regards
    itbcvdw

  6. #6
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Problem setting transparency by VBA in XYScatter chart

    I can not test that till the weekend.

    Maybe somebody with xl2013 available could test.

  7. #7
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Problem setting transparency by VBA in XYScatter chart

    The problem remains with 2013. Perhaps 2014/15/?? will fix it.

  8. #8
    Registered User
    Join Date
    12-15-2013
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Problem setting transparency by VBA in XYScatter chart

    Thank you very much both of you, Andy and Izandol.

    So, I will have to work around the problem. This seems to be a very long-lasting Excel problem.

    itbcvdw

  9. #9
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Problem setting transparency by VBA in XYScatter chart

    I think this slight variation might work.

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    12-15-2013
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Problem setting transparency by VBA in XYScatter chart

    Excellent, Andy! Thank you very much for your perseverance.

    What is the rationale behind this? I added comments to your code according to what is happening:
    Please Login or Register  to view this content.
    Regards
    itbcvdw

  11. #11
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Problem setting transparency by VBA in XYScatter chart

    Visible only does nothing if the marker is already visible. Visible and Solid are there as a reset to make sure it's in the right state.

    I played with the code whilst the Format dialog was displaying the Marker Fill section of the Format Data series.
    That way I could see that certain changes caused the Solid Fill setting to revert to Automatic which disabled the Transparency setting.

  12. #12
    Registered User
    Join Date
    12-15-2013
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Problem setting transparency by VBA in XYScatter chart

    Andy, thank you very much for your help. Much appreciated!

    Cheers
    itbcvdw

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 0
    Last Post: 06-07-2012, 11:09 AM
  2. Problem setting Chart Transparency - Points
    By JohnM3 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-31-2011, 11:00 AM
  3. Create XYScatter Chart
    By knightcloud in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-18-2011, 03:26 AM
  4. DataLabels: Setting fill transparency in VBA.
    By AKK9 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-28-2010, 10:36 AM
  5. problem with min scale property using xyscatter chart
    By sagarsourav in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 10-31-2007, 03:04 AM

Tags for this Thread

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