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
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