I did not get ur question properly, u mean to say, all files are saved as .xls files and few among them contain data as comma seperated? Because when we try to save an excel file with .csv extension,it replaces the .xls extension rite? so can u pls elaborate on this?
Please find the code which will identify the csv or xls/xlsx files in a folder.
Set xl = CreateObject("scripting.filesystemobject")
set fldr = xl.GetFolder("C:\Documents and Settings\Temp\Desktop\Folder").Files ''replace the path of the folder
noOfFiles = fldr.Count
For each token in fldr
fileName1 = token.name
fileNameArr = split(fileName1,".")
If UCase(fileNameArr(ubound(fileNameArr))) = "CSV" Then
reporter.ReportEvent micPass,"This is a CSV file: "&fileName1,"CSV"
Elseif UCase(fileNameArr(ubound(fileNameArr))) = "XLS" or UCase(fileNameArr(ubound(fileNameArr))) = "XLSX" then
reporter.ReportEvent micPass,"This is an Excel file:"&fileName1,"Excel"
reporter.ReportEvent micFail,"This is not CSV or Excel file:"&fileName1,"Error"