+ Reply to Thread
Results 1 to 4 of 4

Macro to open most recent workbook

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    01-30-2011
    Location
    Vancouver, Canada
    MS-Off Ver
    Excel 2010
    Posts
    604

    Macro to open most recent workbook

    Would like to find a macro that opens the most recent workbook. Any help appreciated!!

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,303

    Re: Macro to open most recent workbook

    Hi Xx7,

    Looking in the Object Browser for the word Recent landed me this code:
    Application.RecentFiles(1).Name
    Use the above in a macro that opens a file and see what happens.
    I'd bet if you changed the 1 to a 2, you'd open the second most recent file.

    hope that helps
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Valued Forum Contributor
    Join Date
    09-21-2003
    Location
    British Columbia , Canada
    MS-Off Ver
    03,07,10,13
    Posts
    727

    Re: Macro to open most recent workbook

    Cool.. Thx Marvin. Your right .. you can enter a number to open a different file ... Thx.

    Public Sub Demo()
       On Error Resume Next
       Application.RecentFiles(Application.InputBox("Enter Numer", "open book", 1, , , , , 1)).Open
    End Sub

  4. #4
    Forum Contributor
    Join Date
    01-30-2011
    Location
    Vancouver, Canada
    MS-Off Ver
    Excel 2010
    Posts
    604

    Re: Macro to open most recent workbook

    Beauty... thx!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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