Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
rgb colors for charts cindy Charts and Charting in Excel 4 December 10th 07 03:34 PM
how do you change the default colors in excel charts cydney Charts and Charting in Excel 1 July 26th 06 09:05 PM
Conditional Colors for Charts If Charts and Charting in Excel 0 May 29th 06 05:45 PM
custom colors for pie charts Moh Charts and Charting in Excel 2 April 28th 06 06:28 PM
Matching the colors Column Charts and Pie Charts RohanSewgobind Charts and Charting in Excel 3 April 21st 06 09:35 PM


All times are GMT +1. The time now is 01:50 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"