PC Review


Reply
Thread Tools Rate Thread

Change Colors in Charts

 
 
Carlos Pedro
Guest
Posts: n/a
 
      13th Oct 2008
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..
 
Reply With Quote
 
 
 
 
Jon Peltier
Guest
Posts: n/a
 
      13th Oct 2008
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 (E-Mail Removed)> wrote in message
news:5F9C2E69-11EC-4588-ABA2-(E-Mail Removed)...
> 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..



 
Reply With Quote
 
Carlos Pedro
Guest
Posts: n/a
 
      14th Oct 2008

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 (E-Mail Removed)> wrote in message
> news:5F9C2E69-11EC-4588-ABA2-(E-Mail Removed)...
> > 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..

>
>
>

 
Reply With Quote
 
Jon Peltier
Guest
Posts: n/a
 
      14th Oct 2008
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" <(E-Mail Removed)> wrote in message
news:3BF8DCF6-915A-4D26-8DBC-(E-Mail Removed)...
>
> 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 (E-Mail Removed)> wrote in message
>> news:5F9C2E69-11EC-4588-ABA2-(E-Mail Removed)...
>> > 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..

>>
>>
>>



 
Reply With Quote
 
Carlos Pedro
Guest
Posts: n/a
 
      14th Oct 2008
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 With Quote
 
Jon Peltier
Guest
Posts: n/a
 
      14th Oct 2008
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" <(E-Mail Removed)> wrote in message
news1721104-928F-44B6-BC71-(E-Mail Removed)...
> 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Default colors for charts different than excel, how to change ricky Microsoft Powerpoint 2 25th Mar 2010 10:42 AM
rgb colors for charts cindy Microsoft Excel Charting 4 10th Dec 2007 03:34 PM
how do you change the default colors in excel charts =?Utf-8?B?Y3lkbmV5?= Microsoft Excel Charting 1 26th Jul 2006 09:05 PM
Matching the colors Column Charts and Pie Charts RohanSewgobind Microsoft Excel Charting 3 21st Apr 2006 09:35 PM
How do I change the second rowof colors on charts? =?Utf-8?B?anVsaWVzcHU=?= Microsoft Powerpoint 3 5th Mar 2005 11:55 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:42 PM.