I am using dir()
function in Excel vba programming with filter as ".xls".
But I have input files with the extension both ".xls"
and ".xlsx"
which have to be picked up for the process.
In many systems the macro picks the ".xlsx"
and ".xls"
files even though the filter specified as ".xls"
in the macro.
But in some systems it picks up only "xls"
files and not ".xlsx"
files.
Any specific reason for this?
This doesn't answer the question "why does this happen", but it is a workaround:
Use
".xls?"
or".xls*"
as yourDir
filter:or