2007 Macro Recorder Problem

dplum

Board Regular
Joined
Nov 1, 2006
Messages
217
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?
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
40,380
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
  2. MacOS
There are known issues with the macro recorder in 2007 and charts, due to the complete reworking of the charting engine.
 
Upvote 0

dplum

Board Regular
Joined
Nov 1, 2006
Messages
217
Rory,
Might you be able to provide a link where all known macro recorder problems are documented?

Also, might you know when we can expect to see fixes to the problems that are known?
 
Upvote 0

RoryA

MrExcel MVP, Moderator
Joined
May 2, 2008
Messages
40,380
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
  2. MacOS
There isn't, as far as I know, a list of all of them - it's just a known fact that the macro recorder simply ignores some actions completely. I am not aware of any pending fixes for this - but that doesn't mean they are not in the pipeline. (I would suspect it's not high on the priority list though)
 
Upvote 0

dplum

Board Regular
Joined
Nov 1, 2006
Messages
217
In reading the link provided by Andrew, it appears that the ability to generate code for chart elements (via the macro recorder) will not be made available, because as the article states they have been made read only in 2007, and so the "Status" of this symptom is stated as being "...by design". Therefore Microsoft does not plan to "fix" this "problem".

Andrew,
Might you know of any other Excel objcets in 2007 which the macro recorder is unable to generate code for updates to them?
 
Upvote 0

Forum statistics

Threads
1,191,171
Messages
5,985,067
Members
439,938
Latest member
MAlhash

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
Top