ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Switching Workbooks in vbscript (https://www.excelbanter.com/excel-programming/308021-switching-workbooks-vbscript.html)

Joe[_3_]

Switching Workbooks in vbscript
 
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



kate

Switching Workbooks in vbscript
 
Hi,

Try this:

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

Kate


-----Original Message-----
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


.



All times are GMT +1. The time now is 10:08 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com