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

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
There are known issues with the macro recorder in 2007 and charts, due to the complete reworking of the charting engine.
 
Upvote 0
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
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
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,214,584
Messages
6,120,385
Members
448,956
Latest member
JPav

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