recent file edit, correction

  • Thread starter Patricia Shannon
  • Start date
P

Patricia Shannon

I discovered that my recently used files macro, which allows the user to
delete unwanted files from the recently used files list, which shows up when
you click File, decreased the max nbr of recent files that will be saved.
This contains a correction which sets the max to 9, which is the absolute max
for Excel 2003.

Public Sub EditRecentFiles()
' Created by Patricia Shannon 04/04/2006
' Displays Recently Used files
' Allows selected files to be removed from the list


Dim RecentCntr As Long
Dim NbrRecent As Long

NbrRecent = Application.RecentFiles.Count
MsgBox "Nbr recent files=" & NbrRecent
For RecentCntr = NbrRecent To 1 Step -1
Select Case MsgBox("cntr=" & RecentCntr & " " _
& Application.RecentFiles(RecentCntr).Name _
& vbNewLine & "Delete?", vbYesNoCancel + vbDefaultButton2)
Case vbCancel
GoTo endpgm
Case vbYes
Application.RecentFiles(RecentCntr).Delete
MsgBox "File deleted from recent files list"
Case vbNo
' Do nothing
Case Else
' Do nothin
End Select
Next RecentCntr

Application.RecentFiles.Maximum = 9

endpgm:
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top