View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Jim Rech Jim Rech is offline
external usenet poster
 
Posts: 2,718
Default How do I clear the "recent documents" list?

Excel does not check whether a file still exists when it builds the MRU
list. This is a macro I put in my Personal.xls and I run it automatically
every time Excel starts.

''Removes nonexistent files from XL12's MRU list
Sub CleanupMRU()
Dim wsh As Object, fso As Object
Dim Res As String, Counter As Integer
Dim Ptr As Integer, FName As String
On Error Resume Next
Set wsh = CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
For Counter = 1 To 50
Res = wsh.RegRead("HKCU\Software\Microsoft\Office\12.0\E xcel\File
MRU\Item " & Counter)
Ptr = InStr(1, Res, "*", 1)
If Ptr 0 Then
FName = Mid(Res, Ptr + 1)
If Not fso.FileExists(FName) Then
wsh.RegDelete "HKCU\Software\Microsoft\Office\12.0\Excel\Fil e
MRU\Item " & Counter
End If
End If
Next
End Sub

--
Jim

"Jim" wrote in message
...
|I just installed Office 2007. Word and Excel can't seem to find the recent
| documents even though the files are listed. How can I clear the recent
| documents list? Thanks!
| --
| jim