MrExcel Publishing
Your One Stop for Excel Tips & Solutions

I need to open the first file in a directory.


Posted by Mike Fetch on June 21, 2001 1:38 PM

I need to open the first file in a directory with a
macro.The filename changes but it is always the first
file in the directory. Is there any way to do this?


Posted by mseyf on June 21, 2001 2:34 PM

what do you mean it is always first - how can you tell?

Posted by mseyf on June 21, 2001 2:57 PM


Workbooks.Open ("d:\path\" & Dir("d:\path\"))

will open the first file it finds.

Good luck