| 
    
     |  | 以前、こちらで教えていただいたコードを使って、アルバムを作成しました。 エクセル2003では、アクティブセルに画像がきれいに貼り付けられるのですが、
 2007で使用すると、まったく関係のないところに画像が張り付いてしまいます。
 どのようにコードを変更すれば、2003でも、2007でも機能するのでしょうか。
 
 
 Public Sub InsertPicture()
 Dim fName As Variant
 Dim PicTop As Single
 Dim PicLeft As Single
 
 fName = Application.GetOpenFilename _
 ("画像ファイル,*.gif;*.jpg;*.bmp", 1, "画像挿入")
 
 If fName = False Then
 Exit Sub
 End If
 
 Application.ScreenUpdating = False
 
 With Cells((Val(Mid$(Application.Caller, 5)) - 1) * 13 + 2, 2)
 PicTop = .Top
 PicLeft = .Left
 End With
 
 
 ActiveSheet.Pictures.Insert(fName).Select
 Selection.ShapeRange.LockAspectRatio = msoTrue
 Selection.ShapeRange.Height = 272.25
 Selection.ShapeRange.Width = 363#
 Selection.ShapeRange.Rotation = 0#
 Application.ScreenUpdating = True
 
 End Sub
 
 |  |