S
Stevep4
I have set up a macro which inserts a picture onto a cell (AH34), based upon
the value of another cell (L21 - which provides the filename).
Dim s As String
s = "C:\pictures\" & Range("L21").Value & ".jpg"
Range("ah34").Select
ActiveSheet.Pictures.Insert(s).Select
My problem is that if the file does not exist, I get an error box "type
mismatch"
I would like the situation that if a file is not available, it enters "photo
not available" into the cell instead
Something like
IF file=true insert phto
IF file=false inserts "Photo not available"
Any ideas?
the value of another cell (L21 - which provides the filename).
Dim s As String
s = "C:\pictures\" & Range("L21").Value & ".jpg"
Range("ah34").Select
ActiveSheet.Pictures.Insert(s).Select
My problem is that if the file does not exist, I get an error box "type
mismatch"
I would like the situation that if a file is not available, it enters "photo
not available" into the cell instead
Something like
IF file=true insert phto
IF file=false inserts "Photo not available"
Any ideas?