In Excel 2003 or earlier if I record a macro to assign an image to a set of columns on a Chart I get the following code generated:
Sub Flag_Format_USA()
ActiveChart.SeriesCollection(2).Select
With Selection.Border
.Weight = xlThin
.LineStyle = xlNone
End With
Selection.Shadow = False
Selection.InvertIfNegative = False
Selection.Fill.UserPicture PictureFile:="D:\Files VBA2\Flag-USA.gif" _
, PictureFormat:=xlStack, PicturePlacement:=xlAllFaces
Selection.Fill.Visible = True
End Sub
=================================================================
However, in Excel 2007 when I use the macro recorder and "ask it" to record the same steps taken in 2003 it only generates the following code:
Sub Flag_Format_USA()
ActiveChart.SeriesCollection(2).Select
ActiveSheet.ChartObjects("Chart 1").Activate
End Sub
=================================================================
It appears that 2007's "Macro Recorder Engine" is not operating correctly.
Does anyone have any suggestions that would cause 2007 to generate correct VBA code?
Sub Flag_Format_USA()
ActiveChart.SeriesCollection(2).Select
With Selection.Border
.Weight = xlThin
.LineStyle = xlNone
End With
Selection.Shadow = False
Selection.InvertIfNegative = False
Selection.Fill.UserPicture PictureFile:="D:\Files VBA2\Flag-USA.gif" _
, PictureFormat:=xlStack, PicturePlacement:=xlAllFaces
Selection.Fill.Visible = True
End Sub
=================================================================
However, in Excel 2007 when I use the macro recorder and "ask it" to record the same steps taken in 2003 it only generates the following code:
Sub Flag_Format_USA()
ActiveChart.SeriesCollection(2).Select
ActiveSheet.ChartObjects("Chart 1").Activate
End Sub
=================================================================
It appears that 2007's "Macro Recorder Engine" is not operating correctly.
Does anyone have any suggestions that would cause 2007 to generate correct VBA code?