Open Multiple Files At Once

B

Bill

I know this is easy and I hope I am close. I want to open several files from
different folders. I kow the names of the files so this is what I have.

Workbooks.Open Filename:="Y:\folder\filename.xlsm"

When I run the macro it says file not found. Do I have to use the following
to change folders each time I am using a different folder?

ChDir "Y:\folder"
 
B

Bill

Yes thank you - I went brain dead and had an extra [ in the line that messed
it up.

Thanks



broro183 said:
hi Bill,


I know this is easy and I hope I am close. I want to open several files
from

VBA Code:
--------------------

Workbooks.Open Filename:="Y:\folder\filename.xlsm"

VBA Code:
--------------------

ChDir "Y:\folder"





I don't think you should need to use ChDir (See SHG's comment 'here'
(http://tinyurl.com/2b2tdng)).

Is it possible that there are any spelling mistakes or extra spaces etc
in your file names?
As a matter of course I suggest testing for the file's existence before
performing any actions on it. Here's some an example function:
VBA Code:
 

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