The recent documents feature in Office is really useful, but I moved a file to a new directory and now I can't get Excel to stop hitting me with a "can't find this file" notification whenever I open a workbook. The Excel options seem only to control how many of these "recent documents" are displayed and not how many are actually saved. So I;'m wondering if there's a way in VBA to get at the list and remove the offending file.
Try this...
Public Function TestIt()
For i = 1 To Application.RecentFiles.Count - 1
Dim answer As String
answer = MsgBox("Delete " & Application.RecentFiles(i).Name, vbYesNo)
If answer = vbYes Then
answer = MsgBox("Are you sure?", vbYesNo)
If answer = vbYes Then
Application.RecentFiles(i).Delete
End If
End If
Next i
End Function
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With