BusinessObjects Board

Code for Extracting .rep file from a particular Folder

:?: 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.


Thumma Raghu (BOB member since 2006-03-31)

Can you give some more details about this? Sorry but it sounds very vague to me. What do you mean by reading all .rep documents?


cpmohanraj :australia: (BOB member since 2002-09-23)

:?: 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.


Thumma Raghu (BOB member since 2006-03-31)

Cool, Search for Scripting.FileSystem. This object helps you to access the folders and files using VB.


cpmohanraj :australia: (BOB member since 2002-09-23)

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.


Dwayne Hoffpauir :us: (BOB member since 2002-09-19)


Dwayne Hoffpauir :us: (BOB member since 2002-09-19)