Open file from vba

J

Juan

Hi all...

I have a macro that extracts a series of data that comes
on text format on several files and exports them into a
workbook, it used to be arround 30 files each time so I
renamed them: 1.doc, 2.doc, 3.doc and so on so that the
macro could find them and open them. now I need to rename
arround 600 files, is there a way to open a file from vba
regardless of the name? OPEN NEXT or something like that??
Or can anyone sugest a macro to rename all the files into
the previos format (1.doc, 2.doc,...,2000.doc)?

Any help is greatly appreaciated...

regards
JS
 
J

Juan Pablo González

Juan said:
Hi all...

I have a macro that extracts a series of data that comes
on text format on several files and exports them into a
workbook, it used to be arround 30 files each time so I
renamed them: 1.doc, 2.doc, 3.doc and so on so that the
macro could find them and open them. now I need to rename
arround 600 files, is there a way to open a file from vba
regardless of the name? OPEN NEXT or something like that??
Or can anyone sugest a macro to rename all the files into
the previos format (1.doc, 2.doc,...,2000.doc)?

Any help is greatly appreaciated...

regards
JS

You could adapt the code from here:

http://www.contextures.com/xlfaqMac.html#LoopBooks

to use *.doc instead of *.xls
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top