Create a macro to compile data in multiple .txt files into one .xls file - Part 2 (extraction) - in Excel 2010

Refering to,

I have upgraded from MS office 2000 to office 2010.

and there is an error at the following comment:

Set textFile = FSO.OpenTextFile(currentFile)

see error message :
error message

What has happened ?
Who is Participating?
Saqib Husain, SyedEngineerCommented:

Set textFile = FSO.OpenTextFile(folder & "\" & currentFile)
ceneiqeAuthor Commented:
Thanks it works !

May i understand why  the change in code ?
Saqib Husain, SyedEngineerCommented:
Apparently, previously the default directory was where the files were present. On the new system the files were not in the default directory. This new syntax includes the path name of the file together with the file name.
ceneiqeAuthor Commented:
ok strange. i didn't change the default directory.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.