Macro recording

M

MM

I am unable to record macros that move or format objects - ovals, rectangles,
etc.

Macro security hsd been set to "enable all"
 
G

Gord Dibben

What occurs when you attempt to record a macro performing manipulation of an
object?

Does the recorder work properly for purposes other than moving or formatting
objects?


Gord Dibben MS Excel MVP
 
M

MM

Yes everything else records properly
--
MM


Gord Dibben said:
What occurs when you attempt to record a macro performing manipulation of an
object?

Does the recorder work properly for purposes other than moving or formatting
objects?


Gord Dibben MS Excel MVP
 
G

Gord Dibben

Nothing like this which is what I get when I record?

Sub Macro4()
Application.CommandBars("Drawing").Visible = True
ActiveSheet.Shapes.AddShape(msoShapeRectangle, _
143.25, 11.25, 170.25, 96.75).Select
Range("D13").Select
ActiveSheet.Shapes.AddShape(msoShapeOval, 478.5, 34.5, 174.75, 123#).Select
Range("G12").Select
ActiveSheet.Shapes("Rectangle 1").Select
Selection.ShapeRange.ScaleWidth 1.31, msoFalse, msoScaleFromBottomRight
Selection.ShapeRange.ScaleHeight 1.62, msoFalse, msoScaleFromTopLeft
ActiveSheet.Shapes("Oval 2").Select
Selection.ShapeRange.ScaleHeight 1.77, msoFalse, msoScaleFromTopLeft
Selection.Copy
Range("D23").Select
ActiveSheet.Paste
End Sub

I wouldn't know where to start troubleshooting.

Do you get any error messages?

Do you get the Sub Macro#() and the who and when lines then just End Sub?

Are you recording in the active workbook/worksheet in a single instance of
Excel?

Any ideas out there?

I guess that is a start at troubleshooting after all<g>


Gord
 
M

MM

No, nothing like that

If I start with a spreadsheet with a blue rectangle & a blue triangle

And I manually type the following, the macro will enter 1 in cell A1,
change the color in the rectagle to yellow, enter 2 in cell A3, change the
color in the triangle to yellow, & enter 3 in cell A5

ActiveCell.FormulaR1C1 = "1"
ActiveSheet.Shapes("Rectangle 1").Select
Selection.ShapeRange.Fill.ForeColor.SchemeColor = 13
Selection.ShapeRange.Visible = msoTrue
Selection.ShapeRange.Fill.Solid
Range("A3").Select
ActiveCell.FormulaR1C1 = "2"
ActiveSheet.Shapes("oval 3").Select
Selection.ShapeRange.Fill.ForeColor.SchemeColor = 13
Selection.ShapeRange.Visible = msoTrue
Selection.ShapeRange.Fill.Solid
Range("A5").Select
ActiveCell.FormulaR1C1 = "3"

When I try to record this process, I get the following

Range("A1").Select
ActiveCell.FormulaR1C1 = "1"
Range("A3").Select
ActiveCell.FormulaR1C1 = "2"
Range("A5").Select
ActiveCell.FormulaR1C1 = "3"
Range("A6").Select

I do not receive any error messages

This is what I get I just change to colors on the rectangle & oval

Sub Macro5()
'
' Macro5 Macro
'

'
End Sub


I only have one instance of Excel, one workbook, & one worksheet

I have upgraded to the most recent service pack, no change before or after.

If anyone has any ideas, let me know.
 
G

Gord Dibben

I start out with a Blue Rectangle and a Blue Triangle on the sheet then record
going through your steps.

I don't know why you are not getting any of the shapes manipulation code, most
of which is not necessary but would be nice to record something<g>

I don't see an Excel version anywhere. I do not run 2007 version so may be a
function of that if you are running 2007?

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 3/1/2008 by Gord Dibben
'

'
Range("A1").Select
ActiveCell.FormulaR1C1 = "1"
ActiveSheet.Shapes("Rectangle 1").Select
Selection.ShapeRange.Fill.Visible = msoTrue
Selection.ShapeRange.Fill.Solid
Selection.ShapeRange.Fill.ForeColor.SchemeColor = 13
Selection.ShapeRange.Fill.Transparency = 0#
Selection.ShapeRange.Line.Weight = 0.75
Selection.ShapeRange.Line.DashStyle = msoLineSolid
Selection.ShapeRange.Line.Style = msoLineSingle
Selection.ShapeRange.Line.Transparency = 0#
Selection.ShapeRange.Line.Visible = msoTrue
Selection.ShapeRange.Line.ForeColor.SchemeColor = 64
Selection.ShapeRange.Line.BackColor.RGB = RGB(255, 255, 255)
Range("A3").Select
ActiveCell.FormulaR1C1 = "2"
ActiveSheet.Shapes("AutoShape 2").Select
Selection.ShapeRange.Fill.Visible = msoTrue
Selection.ShapeRange.Fill.Solid
Selection.ShapeRange.Fill.ForeColor.SchemeColor = 13
Selection.ShapeRange.Fill.Transparency = 0#
Selection.ShapeRange.Line.Weight = 0.75
Selection.ShapeRange.Line.DashStyle = msoLineSolid
Selection.ShapeRange.Line.Style = msoLineSingle
Selection.ShapeRange.Line.Transparency = 0#
Selection.ShapeRange.Line.Visible = msoTrue
Selection.ShapeRange.Line.ForeColor.SchemeColor = 64
Selection.ShapeRange.Line.BackColor.RGB = RGB(255, 255, 255)
Range("A5").Select
ActiveCell.FormulaR1C1 = "3"
End Sub


Gord
 
M

MM

I am running office 2007
--
MM


Gord Dibben said:
I start out with a Blue Rectangle and a Blue Triangle on the sheet then record
going through your steps.

I don't know why you are not getting any of the shapes manipulation code, most
of which is not necessary but would be nice to record something<g>

I don't see an Excel version anywhere. I do not run 2007 version so may be a
function of that if you are running 2007?

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 3/1/2008 by Gord Dibben
'

'
Range("A1").Select
ActiveCell.FormulaR1C1 = "1"
ActiveSheet.Shapes("Rectangle 1").Select
Selection.ShapeRange.Fill.Visible = msoTrue
Selection.ShapeRange.Fill.Solid
Selection.ShapeRange.Fill.ForeColor.SchemeColor = 13
Selection.ShapeRange.Fill.Transparency = 0#
Selection.ShapeRange.Line.Weight = 0.75
Selection.ShapeRange.Line.DashStyle = msoLineSolid
Selection.ShapeRange.Line.Style = msoLineSingle
Selection.ShapeRange.Line.Transparency = 0#
Selection.ShapeRange.Line.Visible = msoTrue
Selection.ShapeRange.Line.ForeColor.SchemeColor = 64
Selection.ShapeRange.Line.BackColor.RGB = RGB(255, 255, 255)
Range("A3").Select
ActiveCell.FormulaR1C1 = "2"
ActiveSheet.Shapes("AutoShape 2").Select
Selection.ShapeRange.Fill.Visible = msoTrue
Selection.ShapeRange.Fill.Solid
Selection.ShapeRange.Fill.ForeColor.SchemeColor = 13
Selection.ShapeRange.Fill.Transparency = 0#
Selection.ShapeRange.Line.Weight = 0.75
Selection.ShapeRange.Line.DashStyle = msoLineSolid
Selection.ShapeRange.Line.Style = msoLineSingle
Selection.ShapeRange.Line.Transparency = 0#
Selection.ShapeRange.Line.Visible = msoTrue
Selection.ShapeRange.Line.ForeColor.SchemeColor = 64
Selection.ShapeRange.Line.BackColor.RGB = RGB(255, 255, 255)
Range("A5").Select
ActiveCell.FormulaR1C1 = "3"
End Sub


Gord
 
D

Dave Peterson

I've seen a few posts that describe the same problem with xl2007. Lots of end
with a sigh and a hope that it's fixed in a future release.
 
Top