Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Using VBA to change default color palette

We currently have an add-in for Excel Xp which changes the default excel
color palette so that it displays our companies corporate color scheme. We
are wanting to use this in Excel 2007 as well but cannot get it to work.
Included is some of the code used for Excel XP

Sub companyPalette()
On Error Resume Next
'Modify the first row to compnay Primary color Palette
ActiveWorkbook.Colors(11) = RGB(160, 0, 80)
ActiveWorkbook.Colors(55) = RGB(225, 110, 0)
ActiveWorkbook.Colors(52) = RGB(235, 175, 0)
ActiveWorkbook.Colors(51) = RGB(180, 190, 0)
ActiveWorkbook.Colors(49) = RGB(0, 180, 175)
ActiveWorkbook.Colors(53) = RGB(230, 80, 50)
ActiveWorkbook.Colors(1) = RGB(0, 0, 0)
ActiveWorkbook.Colors(56) = RGB(153, 153, 153)
ActiveWorkbook.Colors(9) = RGB(255, 255, 255)

Can anyone advise how to amend this code to do the same in excel 2007, i
know Excel 2007 uses a different color palette to excel xp


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Using VBA to change default color palette

Your code will work in 2007 and 2007 does support the old 56 palette, albeit
in a limited way.

However 2007 is geared to using Theme colors, you can make your own set and
apply to the workbook. For your purporses probably easier to customize
manually -
Page Layout, Colors, Create New Them colors
Recod a macro to apply the new custom them to a workbook.
You will need to distribute the xml file and save to correct location in
user's systems.

To create a Theme programatically means wrting an xml file to the correct
location (see the recoded macro for the file, open it in say notepad or a
browser). I don't know of anything out there to make it simple, something
I've been meaning to look in to!

If you really want to use the old 56 palette, and I can quite understand why
you might, you'd need to make an app to display the palette and apply the
formats as required. Doable, but a lot of work if you want to cover
everything.

Regards,
Peter T

PS, fwiw and perhaps a bit belated, it cleaner to customize the palette like
this

dim pal
pal = activeworkbook.colors
pal(11) = RGB(160, 0, 80)
pal(55) = RGB(225, 110, 0)
' etc
activeworkbook.colors = pal


"Garyc" wrote in message
...
We currently have an add-in for Excel Xp which changes the default excel
color palette so that it displays our companies corporate color scheme.
We
are wanting to use this in Excel 2007 as well but cannot get it to work.
Included is some of the code used for Excel XP

Sub companyPalette()
On Error Resume Next
'Modify the first row to compnay Primary color Palette
ActiveWorkbook.Colors(11) = RGB(160, 0, 80)
ActiveWorkbook.Colors(55) = RGB(225, 110, 0)
ActiveWorkbook.Colors(52) = RGB(235, 175, 0)
ActiveWorkbook.Colors(51) = RGB(180, 190, 0)
ActiveWorkbook.Colors(49) = RGB(0, 180, 175)
ActiveWorkbook.Colors(53) = RGB(230, 80, 50)
ActiveWorkbook.Colors(1) = RGB(0, 0, 0)
ActiveWorkbook.Colors(56) = RGB(153, 153, 153)
ActiveWorkbook.Colors(9) = RGB(255, 255, 255)

Can anyone advise how to amend this code to do the same in excel 2007, i
know Excel 2007 uses a different color palette to excel xp




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
Pick a color from the default palette Faraz A. Qureshi Excel Programming 2 December 17th 09 05:46 AM
Why does the default Excel color palette change between workbooks ajkajkajk Excel Discussion (Misc queries) 1 December 18th 08 06:05 PM
In MS 2007 Office, how do I set default color palette same as 93-2 Ed L. Excel Discussion (Misc queries) 0 August 27th 08 08:10 PM
How to change the default interior color palette index in Excel 2003 [email protected] Excel Programming 1 March 29th 07 03:04 AM
Excel - Customize Default Color Palette brontesan Excel Programming 2 August 28th 04 01:47 AM


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

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

About Us

"It's about Microsoft Excel"