Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hello Programmers, Is it possible to open a particular file *by name *regardless of what folder it may be in on C drive? Example filename Store Inventory.xls somewhere on C drive The reason is because the file name stays the same, however the file moves to a different folder with the current month's name. So to keep from changing the destination on the macro each month, I just want the code to find the file, by its name. Thanks, EMoe -- EMoe ------------------------------------------------------------------------ EMoe's Profile: http://www.excelforum.com/member.php...o&userid=23183 View this thread: http://www.excelforum.com/showthread...hreadid=493047 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
EMoe,
It would be better if you knew the folder name based on the current date, along the lines of Workbooks.Open "C:\Folder 1\" & Format(Now(),"mmmmyy") & "\Store Inventory.xls" Otherwise, you could use code like this With Application.FileSearch .NewSearch .LookIn = "C:\" .SearchSubFolders = True .FileName = "Store Inventory.xls" If .Execute 0 Then Workbooks.Open .FoundFiles(1) End If End With which will work as long as there is only one Store Inventory.xls on your C drive. HTH, Bernie MS Excel MVP "EMoe" wrote in message ... Hello Programmers, Is it possible to open a particular file *by name *regardless of what folder it may be in on C drive? Example filename Store Inventory.xls somewhere on C drive The reason is because the file name stays the same, however the file moves to a different folder with the current month's name. So to keep from changing the destination on the macro each month, I just want the code to find the file, by its name. Thanks, EMoe -- EMoe ------------------------------------------------------------------------ EMoe's Profile: http://www.excelforum.com/member.php...o&userid=23183 View this thread: http://www.excelforum.com/showthread...hreadid=493047 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Thanks Bernie, I give it a shot! EMoe -- EMoe ------------------------------------------------------------------------ EMoe's Profile: http://www.excelforum.com/member.php...o&userid=23183 View this thread: http://www.excelforum.com/showthread...hreadid=493047 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How can I find a file that I save but can't seem to find | Excel Discussion (Misc queries) | |||
How do I find a deleted excel file? Or an autosave file? | Excel Discussion (Misc queries) | |||
clicking .XLS file opens Excel 2003 but doesn't find the file | Excel Discussion (Misc queries) | |||
How do I find a file/spreadsheet that Excel says is Already open but I can't find it? | Excel Discussion (Misc queries) | |||
Want file title listing as in Excel 5.0 File>Find | Excel Discussion (Misc queries) |