Placing pictures in 2010

JarmoSa

New Member
Joined
Jan 17, 2013
Messages
1
Hi

Can anyone help me with this small problem.

We updated excel from 2003 -> 2010 and this stopped working.

We have a macro which takes pictures from a folder and pastes
those pictures in the excel -sheet.

At 2003 the pictures were correctly pasted to their positions, but
at 2010 the pictures appear in somewhere at the same sheet.
(not at the right places, which should be at column "o" at the
same row.)

Macro (working correctly at 2003) :

Sub Kuvan_piirto(ic As Integer)


On Error GoTo loppu

SourceFile = Enari
DestinationFile = "Live1.JPG" ' Define target file name.
FileCopy SourceFile, DestinationFile
ActiveSheet.Pictures.Insert("Live1.JPG").Select
'Selection.ShapeRange.ScaleWidth 0.15, msoFalse, msoScaleFromBottomRight
'Selection.ShapeRange.ScaleHeight 0.15, msoFalse, msoScaleFromTopLeft

If Selection.ShapeRange.Height / Selection.ShapeRange.Width > 1.1 Then


Selection.ShapeRange.Width = 60
If Selection.ShapeRange.Height < 60 Then
Selection.ShapeRange.Height = 60
End If
Selection.ShapeRange.Rotation = 90#
Else
Selection.ShapeRange.Height = 60
If Selection.ShapeRange.Width > 100 Then
Selection.ShapeRange.Width = 100
End If

End If

With Selection
.Top = Range("O" & ic).Top
.Left = Range("O" & ic).Left
.Placement = xlMove
End With
bLiveOk = True
loppu:


End Sub

What should I change for 2010?

Thanks in advantage
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
try this change
Code:
With Selection.ShapeRange
        .Top = Range("O" & ic).Top
        .Left = Range("O" & ic).Left
        '.Placement = xlMove
    End With
 
Upvote 0

Forum statistics

Threads
1,214,921
Messages
6,122,280
Members
449,075
Latest member
staticfluids

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