Block of code handling looping through files in a directory:
Dim file As Variant
file = Dir(directory)
While (file <> "")
If (InStr(file, ".xlsx") > 0) And (InStr(file, "Percentage") = 0) And (InStr(file, aggregateFilename) = 0) Then
Call fight_dynamics_by_percentage_buckets(aggregateFilename, directory, file, folderToRunMacro, num_buckets)
End If
file = Dir
Wend
Earlier in my code, the user selects a directory storing a set of files. In my test directory, I have the following files:
Analyzed.11.14.383.Chamber1.xlsx
Analyzed.11.14.383.Chamber2.xlsx
Analyzed.11.14.383.Chamber3.xlsx
When I run the macro, the program extracts the filenames as:
Analyzed.11.14.383#494E5A0.xlsx
Analyzed.11.14.383#494E5A1.xlsx
Analyzed.11.14.383#494E5A2.xlsx
I have used this exact code before on previous directories, and have had no trouble extracting the correct filenames.
What's going on here?