How to Activate Open Workbook

G

Guest

I have a macro using two Workbooks. I am appending the sheets from the Trans workbook to the same sheets in the Master workbook.

I open the Master workbook and run the Macro from it.

I open the trans workbook with the following:

myFile = Application.GetOpenFilename("Excel files,*.xls")
Workbooks.Open Filename:=myFile

I then select the sheet, copy the data, Activate the masterfile with the following

Windows("Masterfile.xls").Activate

I select the sheet, paste the data at the end.

The problem I have is when I want to Activate the trans file to work on the next sheet, I get an error when I say:

Windows("myFile").Activate

Also error with:

Windows(myFile).Activate


How can I Activate this workbook.

Thanks for help.

I select
 

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