View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Jim Rech[_2_] Jim Rech[_2_] is offline
external usenet poster
 
Posts: 533
Default How to remove listed shortcuts for deleted Excel files?

Open NotePad and paste this script in. Save it to your desktop with a VBS
extension like UpdateXL12MRU.VBS

Close Notepad and then double-click the file.


Rem Removes nonexistent files from XL12's MRU list

dim wsh, fso, Res, Counter, Ptr, FName, delCount
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
delCount = delCount + 1
wsh.RegDelete "HKCU\Software\Microsoft\Office\12.0\Excel\Fil e MRU\Item "
& Counter
end if
end if
next
if delCount = "" then
Msgbox "No file names removed from MRU list"
else
Msgbox delCount & " file name(s) removed from MRU list"
end if

--
Jim
"Dave" wrote in message
...
I use XP Pro, and Office 2007.

In Excel, there are several deleted Excel files. These file shortcuts
persist on my "quick access" file list on opening Excel. Is there a
"quick &
easy" way to remove these shortcuts?

Thanks!

-- Dave