Out of the clear, blue sky, I am suddenly getting an error that I have never seen before, and I don't know why it's happening, because I have done nothing to cause the problem.
I am attempting to open a .csv file, which I have done successfully for many thousands of times. Here's the code:
ChDir "KathyStringHD:Library:WebServer:Documents:DispatchReports:DispatchReportsFolder:"
NextFile = Dir("")
Do While NextFile <> ""
If NextFile <> ".DS_Store" Then
Extension = Right(NextFile, 4)
If Extension = ".csv" Then
SaveFile = Left(NextFile, Len(NextFile) - 4) & ".xlsx"
MsgBox NextFile
Call ProcessMonthlyReport(NextFile, Extension, SaveFile, sPath, SavePath)
End If
End If
NextFile = Dir
Loop
Everything works except for one file. The name of the file is 'ACTStillwater February, 2013.csv', but when the routine tries to open this one file, the name is corrupted to read 'ACTStillwater Februa#, 6 random hex numbers, then .csv'. The appendage looks like a color code, but I don't have that one in the file itself, or in the PHP script that generated the file. When I go into Finder and get the file info, the name is fine there. As I said, what has me bum-fuzzled is that the error is only on one file.
,
isn't allowed in a filename: msdn.microsoft.com/en-us/library/windows/desktop/… – mechanical_meat Mar 21 '13 at 21:54