Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi,
I have previous go the cod to open the last saved/modified file from the folder like so: Dim xlx As Object, xlw As Object, xls As Object, xlc As Object Dim strFolderName As String Set xlx = CreateObject("Excel.Application") xlx.Visible = True Excel.Application.DisplayAlerts = False strFolderName = "http://srfi.inc.xxxxxx./Daily_Dir/" (our intranet folder) Dim strFileName With Application.FileSearch .NewSearch .LookIn = strFolderName .FileType = msoFileTypeExcelWorkbooks .SearchSubFolders = True .Execute SortBy:=msoSortBySize .LookIn = strFolderName .FileType = msoFileTypeExcelWorkbooks .SearchSubFolders = False If .Execute(msoSortByLastModified, msoSortOrderDescending) 0 Then strFileName = .FoundFiles(1) Workbooks.Open strFileName End If End With it works like a charm. Now, i have a new problem. I would like to use the code above to get a file from other folder, except that I want to open the last modified file with certain name. There are several types of report saved in this folder. The one I am interested in are saved like so: 4/1/06 Open Tickets.xls 4/2/06 Open Tickets.xls 4/3/06 Open Tickets.xls and new ones are added with dates. So what i would like to do is open the last modified file with name containing "Open Tickets". How would I go about doing so? Thank you! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
file is locked does not appear in Excel if file already open by an | New Users to Excel | |||
Advised file is open when not the case | Excel Discussion (Misc queries) | |||
How do you open a template at startup? | Excel Discussion (Misc queries) | |||
Excel file does not open | Excel Discussion (Misc queries) | |||
csv file will not open | New Users to Excel |