actuary
03-17-2011, 03:17 AM
Hello,
I’m trying to open some xml-files using VBA. The problem is that the these files are not all in the same folder. Every day a new file is created in a new directory. The filename is always the same, but the filepath is always different. I’ve got foldernames like 2011-01-14_21-45-16 and 2011-01-15_21-43-22 etc.
The date I’ll always know beforehand (one new directory every day), but the time differs fromday to day. So I want to use a wildcard in searching for the correct foldername.
I tried the following:
filePath =Dir("2011-01-14_*", vbDirectory)
but then filePath = “”. I even tried
filePath =Dir("2011-01-14_21-45-16", vbDirectory) – I know this directory exists, but it still returns a filePath = “”.
I’m probably using the Dir-statement wrong L
Can anybodyhelp me?
I’m trying to open some xml-files using VBA. The problem is that the these files are not all in the same folder. Every day a new file is created in a new directory. The filename is always the same, but the filepath is always different. I’ve got foldernames like 2011-01-14_21-45-16 and 2011-01-15_21-43-22 etc.
The date I’ll always know beforehand (one new directory every day), but the time differs fromday to day. So I want to use a wildcard in searching for the correct foldername.
I tried the following:
filePath =Dir("2011-01-14_*", vbDirectory)
but then filePath = “”. I even tried
filePath =Dir("2011-01-14_21-45-16", vbDirectory) – I know this directory exists, but it still returns a filePath = “”.
I’m probably using the Dir-statement wrong L
Can anybodyhelp me?