Hi all, i have got the code below to work but the only problem now seems to be that it will only create 2 hyperlinks then comes up with "Runtime Error 91, Object variable or With variable not set", why should it work fine for the first 2 but then not subsequent ones?
[vba]
Sub Last_Created_Hyperlink_Test()
Dim fso As New FileSystemObject
Dim fls As Files
Dim i As Integer
Dim Picfile, MyFile As Variant
Dim Mc As Range
Set fls = fso.GetFolder("C:\Documents and Settings\Simon\Desktop\new pics\Staff ID Photos").Files

i = 2

With Worksheets("Photo Details")
.Cells(1, 1) = "File Name"
.Cells(1, 2) = "File Size"
.Cells(1, 3) = "Date Created"
.Cells(1, 4) = "Link To Photo"
.Cells(1, 5) = "LookUp Value"
For Each Picfile In fls
MyFile = "C:\Documents and Settings\Simon\Desktop\new pics\Staff ID Photos\" & Picfile.Name
.Cells(i, 1) = Picfile.Name
.Cells(i, 2) = Picfile.Size
.Cells(i, 3) = Picfile.DateCreated

Set Mc = Sheets("Employee Details").Cells.Find(What:=Worksheets("Photo Details").Cells(i, 5).Value, _
After:=Sheets("Employee Details").Cells(1, 1), _LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:=False, SearchFormat:=False)

MsgBox MyFile''''entered to check the path of each file being hyperlinked
Mc.Offset(0, 11).Hyperlinks.Add Anchor:=Mc.Offset(0, 11), Address:=MyFile, TextToDisplay:="Yes"
i = i + 1
Next
End With
Columns("A:E").AutoFit
End Sub
[/vba]Regards,
Simon
EDIT: It seems to be because the value it has found is created by a formula and not a "pure" entry in the cell any way to cure this?