Solved

How do I get the HEX or RGB numbers for the colours used in Excel Chart Style 2

Posted on 2012-03-26
5
626 Views
Last Modified: 2012-06-27
Hi,

I wish to get the HEX or RBG numbers for the colours that are used in the Excel 2007's chart style 2.

This is the chart style as shown in the sample sheet below.  I have used the macro recorder but that just applies activechart.chartstyle = 2

I am really only interested in the colour of the different data series shown on the example.  Green, Blue, Purple and Red etc.

Thanks
ColourStyle.xlsx
0
Comment
Question by:wobbled
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 37766619
Do you actually need the individual R, G and B component values, or just the overall RGB number?
0
 
LVL 17

Author Comment

by:wobbled
ID: 37766672
The overall RBG should be fine

I'm trying to recreate charts in WPF using a similar style to that available in Excel so I can work with any colour codes that Microsoft accepts
0
 
LVL 85

Accepted Solution

by:
Rory Archibald earned 500 total points
ID: 37766723
OK - for example:
Sub GetRGB()
    Dim n As Long
    With ActiveChart.SeriesCollection
        For n = 1 To .Count
            Debug.Print .Item(n).Border.Color
        Next n
    End With
End Sub

Open in new window


this will output the values to the Immediate Window in the VBE. (you need to select the chart first)
0
 
LVL 12

Expert Comment

by:kgerb
ID: 37766729
Whenever I need to get RGB values for something I use Pixie.  It works well.

Kyle
0
 
LVL 17

Author Closing Comment

by:wobbled
ID: 37766767
Thanks - did the job fine
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This article describes how to import an Outlook PST file to Office 365 using a third party product to avoid Microsoft's Azure command line tool, saving you time.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

626 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question