$$Excel-Macros$$ Re: How to open a file based on newest file in folder

2009-02-05 Thread Joe Wilson
Thanks for below. It works great. How do I get the file to open after it locates the current file? On Thu, Feb 5, 2009 at 11:41 AM, Paul Schreiner wrote: > This should work: > > Option Explicit > Sub lastest_file() > Dim LastFileName, LastFileDate > Dim fso, Folder, f, Files, File >

$$Excel-Macros$$ Re: How to open a file based on newest file in folder

2009-02-05 Thread Paul Schreiner
This should work: Option Explicit Sub lastest_file()     Dim LastFileName, LastFileDate     Dim fso, Folder, f, Files, File     Set fso = CreateObject("Scripting.FileSystemObject")     Folder = "c:\temp3\"     Set f = fso.getfolder(Folder)     Set Files = f.Files     LastFileDate = 0     For Each