+ Reply to Thread
Results 1 to 3 of 3

Updating recent file list when vba saving a workbook

  1. #1
    Registered User
    Join Date
    07-27-2011
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    16

    Updating recent file list when vba saving a workbook

    I have a short macro that saves files to a specific directory and filename based on values in the workbook. The problem is that the file list (I'm using Excel 2007) has the previous file name but not the current one. If I re-open the file using the recent documents short-cut, it will be a previous, obsolete version. Is there a way to make sure the recent documents updates when I save the file. Here's the macro:

    Sub SaveAsExcel()
    ' Save the workbook as an .xlsm file
    Dim fileSaveName As String
    fileSaveName = Range("dirName") & Range("XLfileName")
    ActiveWorkbook.SaveAs Filename:=fileSaveName, FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
    End Sub

    Thanks.

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Updating recent file list when vba saving a workbook

    Hi gren,

    I think you need to close it for the recent documents to grab it.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Registered User
    Join Date
    07-27-2011
    Location
    Canada
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Updating recent file list when vba saving a workbook

    XLA- thanks for the idea, but even after the file has been closed, it's still not showing up in the recent documents list of Excel. It is in Windows Explorer recent document list. But it's not picked up by Excel's recent document list.

    Any other ideas?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1