If you use a variable to represent the object and you dimension it as the
correct type, you can get the VBE to share its intellisense with you.
For example, I'd use:
Dim myPict as Picture
Then when I type:
mypict.
(that dot is the key)
the VBE will show all the properties and methods (liked adjectives and verbs)
that I can use next.
If that's not enough, I can put a watch on that myPict variable and when I step
through the code, I can look at the watch window to see what properties are
available.
Another option is to hit F2 in the VBE. This will show you the Object Browser.
Then rightclick on the righthand side and choose "show hidden members".
Some features in excel have been "superseded" by other objects (like pictures
and controls from the Forms toolbar). But they're still supported by excel and
VBA.
Then you can search for Picture and see all those hidden members. You'll see
that the properties have a different icon than the methods.
Anyway, this alternative code may get you closer:
Option Explicit
Sub Test2()
Dim myCell As Range
Dim picCell As Range
Dim picPath As String
Dim PIC_FOLDER As String
Dim myPict As Picture
PIC_FOLDER = "U:\My Pictures\2000_12_25"
If Right(PIC_FOLDER, 1) <> "\" Then
PIC_FOLDER = PIC_FOLDER & "\"
End If
For Each myCell In ActiveSheet.Range("A2:A10").Cells
If myCell.Value <> "" Then
picPath = PIC_FOLDER & myCell.Value
If Dir(picPath) <> "" Then
Set myPict = myCell.Parent.Pictures.Insert(picPath)
With myCell.Offset(0, 1)
myPict.Top = .Top + 1
myPict.Left = .Left + 1
If myPict.Height + 3 > 409 Then
.EntireRow.RowHeight = 409
Else
.EntireRow.RowHeight = myPict.Height + 3
End If
End With
myPict.Placement = xlMove
End If
End If
Next myCell
End Sub
I don't like to use a constant for the path -- for the problem you had. If I
make it a variable, I can check for that trailing backslash and add it if I
forgot to include it.