Dear users,
I want to ask you if something similar has happened to you and if you know a way to solve it.
I am using a macro wich performs a long series of operations, reading external files, interfacing with matlab, and importing from there images that are created during the operations.
My macro worked perfectly in excel 2003, while in excel 2007 I am having troubles. starting from the way images are pasted.
In 2003 I selected a cell and then when I pasted the image, it used the selected cell as reference and pasted the image starting from there and going down and right.
THe code is something like this:
ActiveSheet.Range("A13").Select
ActiveSheet.Pictures.Insert( _
Directory + "\name_of_the_file.bmp" _
).Select
Selection.ShapeRange.LockAspectRatio = 1
Selection.ShapeRange.Height = ImageHeight
Selection.ShapeRange.Width = ImageWidth
Selection.ShapeRange.Rotation = 0
Selection.ShapeRange.IncrementLeft IncrementRightward
Selection.ShapeRange.IncrementTop IncrementDownward
Now it doesn't seems to be effective anymore. I had proportions setted for the particular screen resolution I had on the old computer, but those proportions are not so drastically changed. It seems that the "ActiveSheet.Range("A13").Select" is not useful to paste anymore.
Is it true?
ANother thing. I noticed that when I Copy one entire Sheet (selecting from the upper left symbol over the cells) and Paste it in another blank sheet, my images loses proportions, even if they are blocked.
FOr example they were at 44% ini both direction, and when I paste them I get 44% and 23%. All the other thing in the page are corrected (width of cells, font dimensions etc)
Do you have any suggestion on how can I solve this? Thank You!
Bookmarks