loDirectoryInfo = New DirectoryInfo(cDirectory) Try loFiles = loDirectoryInfo.GetFiles(cFilter) ' Get all the files in the directory For Each loFile In loFiles loRow = oDataSet.Tables(0).NewRow loRow("Extension") = loFile.Extension loRow("LastUpdate") = loFile.LastWriteTime loRow("Name") = Trim(loFile.Name) loRow("Size") = loFile.LengthSo, the last line is where the problem is. As soon as I have a file name having more than 160 characters, loFile.Length will generate an error.