Nelson78
Well-known Member
- Joined
- Sep 11, 2017
- Messages
- 526
- Office Version
- 2007
Hello everybody.
I have a folder.
C:\Desktop\Monday
This folder contains 1 or 2 workbooks in format .xls
The workbook named "today.xls" is always there.
Sometimes you can find another workbook named "today1234.xls" (figures following "today" could be different depending on not controllable circumstances).
So, I need a macro opening the second one if exists, otherwise I have to open "today.xls".
To perform this, I think I have to loop the workbooks in the folder opening the one with the longest name.
What could be the working code?
Thank's
I have a folder.
C:\Desktop\Monday
This folder contains 1 or 2 workbooks in format .xls
The workbook named "today.xls" is always there.
Sometimes you can find another workbook named "today1234.xls" (figures following "today" could be different depending on not controllable circumstances).
So, I need a macro opening the second one if exists, otherwise I have to open "today.xls".
To perform this, I think I have to loop the workbooks in the folder opening the one with the longest name.
What could be the working code?
Thank's
Last edited: