Can VBA be used to clear the recently used file list?

G

Guest

Is is possible using VBA in Excel to clear ALL items in the recently used
file list?
I'm talking about the recently used files when you click "Start" then
"Documents".
If this is possible, could someone please post the code to do this?

Thanks.
 
N

Norman Jones

HiQuartz,

If you want to hide the Excel recent file list display, try:

Sub Tester()
Application.DisplayRecentFiles = False
End Sub

If you want to clear and re-initialise the list, try:

Sub Tester02()
With Application
.DisplayRecentFiles = False
.DisplayRecentFiles = True
.RecentFiles.Maximum = 3 '<<==== CHANGE TO SUIT
End With
End Sub

Note that neither of the subs erases the windows recent file list, only
Excel's ability to report the list.
 
M

Michel Pierron

Hi quartz,
You can use:
Kill CreateObject("WScript.Shell").SpecialFolders("Recent") & "\*.*"

Regards,
MP
 

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