Hi,
The list of recently opened files appears to retain paths to files that
no longer exist on the system. Is there any way to change this, or to
remove files that no longer exist?

Signature
Gerry Hickman (London UK)
Ron de Bruin - 29 Mar 2008 21:28 GMT
Hi Gerry
No simple way
You can use the example on this page
http://www.rondebruin.nl/ribbon.htm
See the workbook in the Dictator examples in Ribbon tips
You can change thye code and test if the workbook exist before it backup the list

Signature
Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm
> Hi,
>
> The list of recently opened files appears to retain paths to files that
> no longer exist on the system. Is there any way to change this, or to
> remove files that no longer exist?
Dana DeLouis - 29 Mar 2008 22:46 GMT
Would this work?
Sub RecentFiles_Delete_Invalid()
Dim rf As RecentFile
Dim s As String
For Each rf In Application.RecentFiles
s = Dir(rf.Path)
If s = vbNullString Then Application.RecentFiles.Item(rf.Index).Delete
Next
End Sub
> Hi,
>
> The list of recently opened files appears to retain paths to files that
> no longer exist on the system. Is there any way to change this, or to
> remove files that no longer exist?
Dana DeLouis - 30 Mar 2008 01:03 GMT
Just an added note:
Sub Demo()
' Turn off, or Erase list
Application.RecentFiles.Maximum = 0
' Reset
Application.RecentFiles.Maximum = 50
End Sub
I believe the documentation of "9" for the "Maximum" is incorrect for
2007. If I'm not mistaken, I believe it's 50.
- -
HTH
Dana DeLouis
> Would this work?
>
[quoted text clipped - 12 lines]
>> that no longer exist on the system. Is there any way to change this,
>> or to remove files that no longer exist?
Dana DeLouis - 30 Mar 2008 04:38 GMT
Oops! Me bad. The item is index only, therefore I believe you need to
delete them from the bottom up. Try this instead...
Sub RecentFiles_Delete_Invalid()
'// = = = = = = = = = = = = = = =
'// Remove files from MRU that no longer exists
'// = = = = = = = = = = = = = = =
Dim s As String
Dim j As Long
If .RecentFiles.Maximum = 0 Then Exit Sub
With Application
For j = .RecentFiles.Count To 1 Step -1
s = Dir(.RecentFiles.Item(j).Path)
If s = vbNullString Then .RecentFiles.Item(j).Delete
Next
End With
End Sub

Signature
HTH :>)
Dana DeLouis
<snip>
>
>> Hi,
>>
>> The list of recently opened files appears to retain paths to files that
>> no longer exist on the system. Is there any way to change this, or to
>> remove files that no longer exist?
Gerry Hickman - 30 Mar 2008 12:41 GMT
Hi,
Interesting solution, but in this case I was looking for something
simple in the UI for home users.
Your code looks a bit like VBA, isn't it supposed to have all changed to
.NET these days?
> Oops! Me bad. The item is index only, therefore I believe you need to
> delete them from the bottom up. Try this instead...
[quoted text clipped - 16 lines]
> End With
> End Sub

Signature
Gerry Hickman (London UK)
Jim Rech - 30 Mar 2008 16:16 GMT
>>isn't it supposed to have all changed to .NET these days?
VBA is alive and well in Office. And will be for a long time.

Signature
Jim
> Hi,
>
[quoted text clipped - 24 lines]
>> End With
>> End Sub
Teufik - 28 Apr 2008 11:43 GMT
Hi Gerry
In case you have not find the easier answer, here you are go:
Clik Start - run - regedit - HKEY_CURRENT_USER \ Software \ Microsoft \
Office\ 12.0 \ Excel \ file MRU Click on it and from the right side find one
you want to remove and delete it.
As always, when you work with registry it´s good idea to make a backup of it
before making any changes (in the registry editor click on File - export and
save where you want).
And that´s it.
Regards
Teufik
> Hi,
>
> The list of recently opened files appears to retain paths to files that
> no longer exist on the system. Is there any way to change this, or to
> remove files that no longer exist?