Re: Get Files From Directory
I dont use Collections but it looks like you are trying to use it as a simple variable. You need something like this:
filenames.Add GetFiles("E:\Documents and Settings\User1\My Documents\User2\VCV\stim", "*.wav")
Also,
Code:
For c = 0 To Len(files)
Debug.Print files(c); " ";
Next c
perhaps should be:
Code:
For c = 0 To filenames.Count
Debug.Print filenames.Item(c); " "; ' Not sure about ; " ";
Next c
Also, you are using Option Explicit so you need to define c
Why not just use the File control; filter it for .wav only and bingo you're all set to go. It does all the work for you.
Re: Get Files From Directory
Thanks jmsrickland. I'll have a look into the File control.
I seem to have resolved the problem by using Set to assign filenames. i.e.
Set filenames = GetFiles("E:\Documents and Settings\User1\My Documents\User2\VCV\stim", "*.wav")
Jeff
Re: Get Files From Directory
Collection objects are nice when you want to store data of different data types but when it comes to just plain o'text the Listbox Control and the FileList Control are really nice to have.