|
すいません、タイプミスで Pictures の "r" が抜けていたようです。
こんなコードでテストしてみて下さい。
Sub MyPic_Ins()
Dim i As Integer
Dim Tp As Single, Wp As Single, Hp As Single
Dim FN As String
With Application.FileSearch
.LookIn = "C:\My Documents\My Pictures"
.FileName = "*.jpg"
.FileType = msoFileTypeAllFiles
If .Execute(SortBy:=msoSortbyFileName, _
SortOrder:=msoSortOrderAscending) > 0 Then
For i = 1 To .FoundFiles.Count
With Cells(i, 1)
Tp = .Top: Wp = .Width: Hp = .Height
End With
FN = .FoundFiles(i)
With ActiveSheet.Pictures.Insert(FN)
.Left = 0: .Top = Tp: .Width = Wp: .Height = Hp
End With
Next i
End With
End Sub
|
|