PDA

View Full Version : Moving pictures 2003 vs 2007



slang
06-14-2011, 04:23 AM
I am moving from 2003 to 2007 and it looks like 2007 handles picture objects differently than 2003. I tried to cheat and use the macro recorder but it would not pick up the events at all.:dunno
Is there a different method I should be using or is it possible in 2007?

Thanks again Excel GODS.....:bow:
This is what I used in 2003

ActiveSheet.Pictures.Insert("C:\all retailers\nophoto.jpg").Select
Selection.ShapeRange.ScaleWidth 0.25, msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.ScaleHeight 0.25, msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.LockAspectRatio = msoTrue
Selection.ShapeRange.Height = 80#
Selection.ShapeRange.Width = 80#
Selection.Name = "front"

slang
06-14-2011, 10:08 AM
I am moving from 2003 to 2007 and it looks like 2007 handles picture objects differently than 2003. I tried to cheat and use the macro recorder but it would not pick up the events at all.:dunno
Is there a different method I should be using or is it possible in 2007?

Thanks again Excel GODS.....:bow:
This is what I used in 2003

ActiveSheet.Pictures.Insert("C:\all retailers\nophoto.jpg").Select
Selection.ShapeRange.ScaleWidth 0.25, msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.ScaleHeight 0.25, msoFalse, msoScaleFromTopLeft
Selection.ShapeRange.LockAspectRatio = msoTrue
Selection.ShapeRange.Height = 80#
Selection.ShapeRange.Width = 80#
Selection.Name = "front"

The code works fine and resizes as usuall but the placement of the picture is different in 2007.
Before I selected the cell B10 and it inserted the picture starting in that cell. With 2007 it just seems insert them at the same spot everytime which seems to be around C5. Doesnt make any diff what cell is selected it just keeps inserting them at the same spot.
I cant even move the picture to another location in VB?

Oh the pain of upgrading :banghead: