View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default Activating workbook with variable Name

I don't really understand what you are trying to do?

I have a example on my site that is doing something like you want
http://www.rondebruin.nl/copy3.htm

mybook in the code is the workbook that is open on the moment in the loop.


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Mark Klaus" wrote in message ...
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