![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Posts: 19
|
hi everybody,
In my workbook i have a macro which copies 'values' from 3 sheets to another workbook. To copy from and return i used ActiveWindow.ActivateNext or ActiveWindow.ActivatePrevious. This worked fine when the workbook was saved as .xls but not when it's saved as template (.xlt) I read something about a Count property you can use to determine how many visible and hidden workbooks are open. Can someone help me with an alternative way to 'switch' between 2 workbooks even if other workbooks are opened at that moment? Rudi |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Monterrey, Mexico
Posts: 1,433
|
Try something like:
Windows("Book1.xls").Activate Change the Window name to whatever you want.
__________________
Kind regards, Al Chara |
|
|
|
|
|
#3 | |
|
New Member
Join Date: Apr 2002
Posts: 19
|
Quote:
when you save the workbook as template in the XLstart file the name will not be workbook but workbook1 when it's opened |
|
|
|
|
|
|
#4 | |
|
New Member
Join Date: Apr 2002
Posts: 19
|
Quote:
when you save the workbook as template in the XLstart file the name will not be workbook but workbook1 when it's opened |
|
|
|
|
|
|
#5 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Monterrey, Mexico
Posts: 1,433
|
You can try using AppActivate (probably won't work):
AppActivate "Microsoft Excel - Book1.xlt"
__________________
Kind regards, Al Chara |
|
|
|
|
|
#6 | |
|
New Member
Join Date: Apr 2002
Posts: 19
|
Quote:
If the name of the active workbook, where the 'values' are to be copied from, could be refreshed at the start of the macro one could refer to that and the other workbook. |
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|