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

Refering to http://www.experts-exchange.com/Software/Office_Productivity/Office_Suites/MS_Office/Excel/Q_27291376.html,

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 ?
ceneiqeAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Saqib Husain, SyedConnect With a Mentor EngineerCommented:
try

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

May i understand why  the change in code ?
0
 
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.
0
 
ceneiqeAuthor Commented:
ok strange. i didn't change the default directory.
0
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.