Solved

Default Colors in Microsoft Office Excel Chart OLE Objects

Posted on 2011-02-24
7
688 Views
Last Modified: 2012-05-11
I am using a Powerpoint 2007 add-in that works specifically with Microsoft Office Excel Chart OLE Objects ("Insert > Object > Microsoft Office Excel Chart"). I have setup a custom color pallet in both PowerPoint and Excel that is used as the default in new PPT and XLS files. However, when I insert a Microsoft Office Excel Chart OLE Object into a PowerPoint file, this custom color pallet is not used as the default. Instead, the colors revert back to the "Office" pallet. Does anyone know why these embedded objects don't use the color pallet that I have defined in the "XLSTART\book.xltx" template? Even better, does anyone know how I get the default color pallet to be anything other than "Office" for these embedded Microsoft Office Excel Chart OLE Objects?
0
Comment
Question by:ff13056
  • 3
  • 2
7 Comments
 
LVL 19

Expert Comment

by:akoster
ID: 34969389
Have you tried saving the chart as a chart template (crtx) ?

from Excel 2007 for dummies in google books format :
Google books link
0
 

Author Comment

by:ff13056
ID: 34972040
Thanks for the reply. I tried your suggestion and it worked, but I'm wondering if there is a solution that has a more global effect. The CRTX option works on a chart-by-chart basis, but I have presentations with 30-40 charts embedded in them, each of a different size and type, so creating and using that many chart templates would be difficult to manage. Is there a way to simply change the colors in the "Office" color pallet? If I could change them globally I think that would solve my problem. Can the colors in the Office pallet be changed? Can the colors in the Office pallet be changed?
0
 
LVL 19

Expert Comment

by:akoster
ID: 35016300
Apperently, Excel and Powerpoint uses color themes, but they are not linked !

E.G. when excel uses an arbitrary excel theme, then copies a chart which is pasted in powerpoint, the active powerpoint theme will be applied to the chart.
It seems that the themes themselves are linked, when I change a custom theme in powerpoint, the corresponding theme in excel is updated as well.

Thus the problem seems to be that powerpoint does not default to the correct custom theme. Can you verify that when you manually select the correct custom theme, charts are pasted as you expect them to be ?

If not, you might want to think about pasting charts as pictures :
click on "Paste special", select "Bitmap" (or any other picture type)


0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:ff13056
ID: 35019450
When they first get inserted into the PPT the colors are correct. I have the same theme selected in PPT and Excel, which appears to be working. However, when I run a procedure that updates the chart with new data the colors in the chart revert back to the Office theme. Unfortunately going the picture format route is not an option, as these charts are dynamic and will continuously be updated with new data.
0
 
LVL 19

Accepted Solution

by:
akoster earned 500 total points
ID: 35034816
You could update the procedures to refresh the images, rather than the data, such as in

http://www.vbaexpress.com/forum/showthread.php?t=392

although this is merely a quick fix, i'd rather use code like this :
Sub discover_theme_color_values()

    Set scheme = ActivePresentation.Slides(1).ThemeColorScheme
    For t = 1 To scheme.Count
        Debug.Print "theme color " & t & " has RGB value " & scheme(t)
    Next

End Sub

Open in new window


with the code above, you can get the RGB color values for the active theme. You can then reinforce these values after updating the charts using a function such as below. You can choose to type out the names of the theme colors (upper part of the reinforce sub), or use the values as found in the debug output as in the lower part of the reinforce sub.
 
Sub reinforce_theme_color_values()

    ActivePresentation.Slides(1).ThemeColorScheme(msoThemeDark1) = 12611584
    ActivePresentation.Slides(1).ThemeColorScheme(msoThemeLight1) = 15784390
    [...] 
    ActivePresentation.Slides(1).ThemeColorScheme(1) = 12611584
    ActivePresentation.Slides(1).ThemeColorScheme(2) = 15784390
End Sub

Open in new window


0
 
LVL 24

Expert Comment

by:broomee9
ID: 35356940
This question has been classified as abandoned and is being closed as part of the Cleanup Program. See my comment at the end of the question for more details.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

920 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now