Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Change Colors in Charts
Hello, I'm looking the equivelent in c++ for the following VBA code:
Sub change_series_color() Set ch = Worksheets(1).ChartObjects(1) Set objSeries = ch.Chart.SeriesCollection(1) objSeries.Interior.Color = RGB(255, 127, 0) End Sub I can get the SeriesCollection of the chart, however, the Series Object doesn't expose a property for its interior or it's interior color.. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Change Colors in Charts
What kind of chart is it? Some series types do not have an interior
property. Also, unless you're using Excel 2007, RGB(r, g, b) will apply the color in Excel's palette which Excel decides is closest to the RGB values specified. It might be close, or it might not. Check out color index to use any of the 56 colors in the Excel palette. - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions Peltier Technical Services, Inc. - http://PeltierTech.com _______ "Carlos Pedro" <Carlos wrote in message ... Hello, I'm looking the equivelent in c++ for the following VBA code: Sub change_series_color() Set ch = Worksheets(1).ChartObjects(1) Set objSeries = ch.Chart.SeriesCollection(1) objSeries.Interior.Color = RGB(255, 127, 0) End Sub I can get the SeriesCollection of the chart, however, the Series Object doesn't expose a property for its interior or it's interior color.. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Change Colors in Charts
Hellol, I'm using a xl3DColumnStacked chart. And I do know that the colour wont be exacly the one I chose, However I can't find a way to change the color of the chart, Is there a reference for Excel development using COM and C++=? Best Regards, Carlos Pedro "Jon Peltier" wrote: What kind of chart is it? Some series types do not have an interior property. Also, unless you're using Excel 2007, RGB(r, g, b) will apply the color in Excel's palette which Excel decides is closest to the RGB values specified. It might be close, or it might not. Check out color index to use any of the 56 colors in the Excel palette. - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions Peltier Technical Services, Inc. - http://PeltierTech.com _______ "Carlos Pedro" <Carlos wrote in message ... Hello, I'm looking the equivelent in c++ for the following VBA code: Sub change_series_color() Set ch = Worksheets(1).ChartObjects(1) Set objSeries = ch.Chart.SeriesCollection(1) objSeries.Interior.Color = RGB(255, 127, 0) End Sub I can get the SeriesCollection of the chart, however, the Series Object doesn't expose a property for its interior or it's interior color.. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Change Colors in Charts
The vba code is fine. I guess you're asking for C++ help, which I cannot
provide. However, a quick Google search of 'Excel chart c++' turned up quite a number of potentially helpful links. - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions Peltier Technical Services, Inc. - http://PeltierTech.com _______ "Carlos Pedro" wrote in message ... Hellol, I'm using a xl3DColumnStacked chart. And I do know that the colour wont be exacly the one I chose, However I can't find a way to change the color of the chart, Is there a reference for Excel development using COM and C++=? Best Regards, Carlos Pedro "Jon Peltier" wrote: What kind of chart is it? Some series types do not have an interior property. Also, unless you're using Excel 2007, RGB(r, g, b) will apply the color in Excel's palette which Excel decides is closest to the RGB values specified. It might be close, or it might not. Check out color index to use any of the 56 colors in the Excel palette. - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions Peltier Technical Services, Inc. - http://PeltierTech.com _______ "Carlos Pedro" <Carlos wrote in message ... Hello, I'm looking the equivelent in c++ for the following VBA code: Sub change_series_color() Set ch = Worksheets(1).ChartObjects(1) Set objSeries = ch.Chart.SeriesCollection(1) objSeries.Interior.Color = RGB(255, 127, 0) End Sub I can get the SeriesCollection of the chart, however, the Series Object doesn't expose a property for its interior or it's interior color.. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Change Colors in Charts
I've googled "Excel Chart C++" and looked through the results, so far I got
nothing helpfull. There are even a few articles in MSDN about Excel C++ programming but nothing about changing a series color. Is there another forum where I can ask about this? Some reference book about c++ excel programming? I've even searched in amazon for a C++ Office programming book and didn't find anything. |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Change Colors in Charts
If the code exists in VBA, there has to be a generic way to convert it into
C++ syntax. And yes, there are probably C++ forums that you could look into. Google probably knows some of them. - Jon ------- Jon Peltier, Microsoft Excel MVP Tutorials and Custom Solutions Peltier Technical Services, Inc. - http://PeltierTech.com _______ "Carlos Pedro" wrote in message ... I've googled "Excel Chart C++" and looked through the results, so far I got nothing helpfull. There are even a few articles in MSDN about Excel C++ programming but nothing about changing a series color. Is there another forum where I can ask about this? Some reference book about c++ excel programming? I've even searched in amazon for a C++ Office programming book and didn't find anything. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
rgb colors for charts | Charts and Charting in Excel | |||
how do you change the default colors in excel charts | Charts and Charting in Excel | |||
Conditional Colors for Charts | Charts and Charting in Excel | |||
custom colors for pie charts | Charts and Charting in Excel | |||
Matching the colors Column Charts and Pie Charts | Charts and Charting in Excel |