Hi,

I have developed a macro to read a large number of csv files (~ 50,000) and act on its contents. The csv files are very small (~1kB). I use the following command to open the csv file.
Workbooks.OpenText Filename:=strPath & strFile, DataType:=xlDelimited, Comma:=True, Local:=True

In each loop, I open the csv file, read the content and close that csv file.

The code works fine in Excel 2010. But when I execute in Excel 2013 (in multiple comuputers), the operation takes a very long time (for the entire loop to complete).

I added code to find out which operation takes more time and identifiedWorkbooks.OpenText (opening csv file) operation as the time consuming operation.

Interestingly, this time keeps increasing as the loop progresses (initially, Workbooks.OpenText took about ~70ms, but after 100 files, the time has increased to ~200ms and it shows increasing trend).

Whereas the same code in Excel 2010, Workbooks.OpenText constantly takes about 30ms for all the iterations.

Can you please help in solving this issue? Appreciate your help.

Best Regards,
Maruthu