Converting Existing Charts to RGB...

Lidsavr

Active Member
Joined
Jan 10, 2008
Messages
330
I've read Excel Help files (HELP!!!) :eek:, and have searched this board and cannot find examples of what I am looking for.

I have a file with around 120 charts. The file was created in Excel 2007 (Compatability mode), so users with older versions can view the information. Excel 2007 autoformats the charts with the new color schemes. The makes the formatting of the charts do strange things when viewed with a different version.

I need code to convert all the existing charts to RGB format. I've tried:

Code:
Sub Convert_Existing_Charts_to_RGB
'
' Convert_Charts_to_RGB Macro
'

'Changes the color of charts on worksheets 4-21 to RGB
Worksheets(43).Range("A1:R65536").Interior.Color = _
    Charts(4).ChartArea.Fill.ForeColor.RGB
Worksheets(43).Range("A1:R65536").Interior.Color = _
    Charts(5).ChartArea.Fill.ForeColor.RGB
Worksheets(43).Range("A1:R65536").Interior.Color = _
    Charts(6).ChartArea.Fill.ForeColor.RGB 
Worksheets(43).Range("A1:R65536").Interior.Color = _
    Charts(7).ChartArea.Fill.ForeColor.RGB
Worksheets(43).Range("A1:R65536").Interior.Color = _
    Charts(8).ChartArea.Fill.ForeColor.RGB
Worksheets(43).Range("A1:R65536").Interior.Color = _
    Charts(9).ChartArea.Fill.ForeColor.RGB
Worksheets(43).Range("A1:R65536").Interior.Color = _
    Charts(10).ChartArea.Fill.ForeColor.RGB
Worksheets(43).Range("A1:R65536").Interior.Color = _
    Charts(11).ChartArea.Fill.ForeColor.RGB
Worksheets(43).Range("A1:R65536").Interior.Color = _
    Charts(12).ChartArea.Fill.ForeColor.RGB
Worksheets(43).Range("A1:R65536").Interior.Color = _
    Charts(13).ChartArea.Fill.ForeColor.RGB
Worksheets(43).Range("A1:R65536").Interior.Color = _
    Charts(14).ChartArea.Fill.ForeColor.RGB
Worksheets(43).Range("A1:R65536").Interior.Color = _
    Charts(15).ChartArea.Fill.ForeColor.RGB
Worksheets(43).Range("A1:R65536").Interior.Color = _
    Charts(16).ChartArea.Fill.ForeColor.RGB
Worksheets(43).Range("A1:R65536").Interior.Color = _
    Charts(17).ChartArea.Fill.ForeColor.RGB
Worksheets(43).Range("A1:R65536").Interior.Color = _
    Charts(18).ChartArea.Fill.ForeColor.RGB
Worksheets(43).Range("A1:R65536").Interior.Color = _
    Charts(19).ChartArea.Fill.ForeColor.RGB
Worksheets(43).Range("A1:R65536").Interior.Color = _
    Charts(20).ChartArea.Fill.ForeColor.RGB
Worksheets(43).Range("A1:R65536").Interior.Color = _
    Charts(21).ChartArea.Fill.ForeColor.RGB

End Sub

The charts are on worksheets 4-21. The data is on worksheet 43. When I run this macro, I get the following error:

Run-time error '9':

Subscript out of range

What am I missing here?

Thanks,

Lidsavr
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.

Forum statistics

Threads
1,217,380
Messages
6,136,226
Members
450,000
Latest member
jgp19

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top