I've read Excel Help files (HELP!!!)
, 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:
The charts are on worksheets 4-21. The data is on worksheet 43. When I run this macro, I get the following error:
What am I missing here?
Thanks,
Lidsavr
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