Results 1 to 8 of 8

Thread: How to clear Recent Places

  1. #1
    Acolyte rdwray's Avatar
    Join Date
    Mar 2017
    Posts
    28
    Articles
    0
    Excel Version
    2010

    How to clear Recent Places



    Register for a FREE account, and/
    or Log in to avoid these ads!

    How to clear "Recent Places" list with VBA, I have a hidden folder that I do not want the path for it displayed.

  2. #2
    Conjurer Logit's Avatar
    Join Date
    Nov 2016
    Posts
    221
    Articles
    0
    Excel Version
    2007
    Code:
    Option Explicit
    'API declaration to clear the "recent documents" list
    Private Declare Sub SHAddToRecentDocs Lib "shell32" _
                    (ByVal uFlags As Long, ByVal pv As Any)
    
    
    
    
    Sub ClearRecentDocs()
    '   Clear the 'Start' menu list
        SHAddToRecentDocs 0, CLng(0)
        
    '   Clear Excel's list in the file menu and task pane
        With Application
    
    
    '   If recent file tracking is already off, why clear?
        If .DisplayRecentFiles = False Then
            Exit Sub
            
            
        Else
    
    
    
    
    '       If it's not, toggle the setting to clear
    '       and hide the task pane if it's visible
            .DisplayRecentFiles = False
            
            On Error Resume Next
            .CommandBars("Task Pane").Visible = False
            On Error GoTo 0
            
            .DisplayRecentFiles = True
            
        End If
        
        End With
        
    End Sub

  3. #3
    Acolyte rdwray's Avatar
    Join Date
    Mar 2017
    Posts
    28
    Articles
    0
    Excel Version
    2010
    Quote Originally Posted by Logit View Post
    Code:
    Option Explicit
    'API declaration to clear the "recent documents" list
    Private Declare Sub SHAddToRecentDocs Lib "shell32" _
                    (ByVal uFlags As Long, ByVal pv As Any)
    
    
    
    
    Sub ClearRecentDocs()
    '   Clear the 'Start' menu list
        SHAddToRecentDocs 0, CLng(0)
        
    '   Clear Excel's list in the file menu and task pane
        With Application
    
    
    '   If recent file tracking is already off, why clear?
        If .DisplayRecentFiles = False Then
            Exit Sub
            
            
        Else
    
    
    
    
    '       If it's not, toggle the setting to clear
    '       and hide the task pane if it's visible
            .DisplayRecentFiles = False
            
            On Error Resume Next
            .CommandBars("Task Pane").Visible = False
            On Error GoTo 0
            
            .DisplayRecentFiles = True
            
        End If
        
        End With
        
    End Sub
    Thanks, but not the "Recent File" list, the "Recent Places" list.

  4. #4
    Conjurer Logit's Avatar
    Join Date
    Nov 2016
    Posts
    221
    Articles
    0
    Excel Version
    2007
    https://windows.tips.net/T005838_Rem...ess_Lists.html

    https://www.tenforums.com/tutorials/...dows-10-a.html

    You can also record a macro of your actions while going through the steps of clearing the Recent Places List.

  5. #5
    Administrator Pecoflyer's Avatar
    Join Date
    Oct 2011
    Location
    Brussels Belgium
    Posts
    1,650
    Articles
    0
    Excel Version
    2010 on Xubuntu
    @rdw
    Please do not quote entire posts unnecessarily. They are just clutter -Thx
    Thank you Ken for this secure forum.

  6. #6
    Acolyte rdwray's Avatar
    Join Date
    Mar 2017
    Posts
    28
    Articles
    0
    Excel Version
    2010
    Quote Originally Posted by Logit View Post
    You can also record a macro of your actions while going through the steps of clearing the Recent Places List.
    Office 2010 will not allow you to record a macro if you have to do it in "Option", it simply gives you a blank.

  7. #7
    Acolyte rdwray's Avatar
    Join Date
    Mar 2017
    Posts
    28
    Articles
    0
    Excel Version
    2010
    Not being argumentative, and it can be edited, but the forum automatically quotes the entire post that you are replying - I will keep your suggestion in mind as I did with Logit.

  8. #8
    Administrator Pecoflyer's Avatar
    Join Date
    Oct 2011
    Location
    Brussels Belgium
    Posts
    1,650
    Articles
    0
    Excel Version
    2010 on Xubuntu
    Use the "reply to thread" button. If it works for me it should work for you
    Thank you Ken for this secure forum.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •