How to read all .rep files from a particular directory i.e First I want to count No of .rep file in a folder for example c:\xxx*.rep and store all names in a Array after that I want to open each and every .rep file through VBA Macro.
How to read all .rep files from a particular directory i.e First I want to count No of .rep file in a folder for example c:\xxx*.rep and store all .rep file names in a Array after that I want to open each and every .rep file based on that Array file names through VBA Macro.
I would recommend the Dir function in VBA. It is called first with the filespec you are searching (like *.rep). It is then subsequently called with just the Dir command to get the next filename, repeating your loop until the call returns an empty string (“”). Sounds exactly like what you are after.
There is an example of using the Dir function in this utility here on BOB.