Activating workbook with variable Name

M

Mark Klaus

Hi,

I'm using VB to open each file in a certain directory,
copy info from each into a file and then closing the
opened file before looping to the next file.

Everything works fine except that I cannot figure out the
correct syntax to reactivate (or get the focus on) each
file after copying from it. The variable name is MyFile
defined as:

MyFile = Dir("F:\common\budget\import\" & "*.xls")

I've tried:

Windows("myfile.xls").Activate
Windows("myfile").Activate
Myfile.Activate

etc. without any luck.

Help greatly appreciated
 

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