Switching Workbooks in vbscript

  • Thread starter Thread starter Joe
  • Start date Start date
J

Joe

Hello all and thanks for any help that you can provide. I am trying to
switch between two open workbooks in excel using vbscript. I am able to
open one workbook and create another just fine, but the act of switching
workbooks to copy data from one to the other is kinda stumping me. I just
know it is something fairly simple, but I cannot seem to remember the
command. I tried:

objxl.Workbooks("Book1").Select

but received an error. Any help at all on this would be greatly
appreciated.

Thanks,

Joe
 
Hi,

Try this:

Selection.Copy
Windows("main.xls").Activate
Sheets("Sheet1").Range("A1").Select
Selection.Paste

Kate
 

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

Back
Top