• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 351
  • Last Modified:

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 ?
0
ceneiqe
Asked:
ceneiqe
  • 2
  • 2
1 Solution
 
Saqib Husain, SyedEngineerCommented:
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

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now