Recent workbooks and recent folders - Excel 2013 RRS feed

  • Question

  • When you select File > Open in Excel you get a list of recent workbooks, and a list of recent folders.  I want to write code to remove certain files and folders from these lists, if they appear there.

    It is possible to do this manually - you select one of the items in these lists and right click gives you the option of deleting it.

    It is also easy to write code to delete items from the recent workbooks list - using the Recentfiles collection of the Application object.

    But I cannot see what code will enable me to manipulate items in the recent folders list.

    Can somebody point me in the right direction?

    Monday, September 22, 2014 7:07 PM


All replies

  • Hello Jimmy,

    The list of recent files is stored in the windows registry. See How to clear the Most Recently Used list (MRU) list in Office programs for more information.

    What do want to do with files? Do you develop an add-in or standalone application?

    • Marked as answer by Jimmy6431 Saturday, September 27, 2014 8:07 PM
    Monday, September 22, 2014 7:25 PM
  • Thanks Eugene.   But that is not the direction I was looking.

    I wanted to say something pretty simple.  In Excel 2013 the tools exist to write code which effectively edits the list of recently used workbooks. For instance, this code works I think:

    Sub EditRecentFilesList()
    Dim i As Integer
    For i = Application.RecentFiles.Count To 1 Step -1
    If InStr(1, Application.RecentFiles(i).Name, "xyz", vbTextCompare) > 0 Then
    End If
    Next i
    End Sub

    However, I could not see a way to write similar code to edit the list of recently used folders.

    Within Excel, it is possible manually to edit both lists (in the File > Open screen).

    Tuesday, September 23, 2014 8:53 PM