Alternative for ActivateNext or Previous Window

Rudi

New Member
Joined
Apr 15, 2002
Messages
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
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Try something like:
Windows("Book1.xls").Activate

Change the Window name to whatever you want.
 
Upvote 0
On 2002-04-17 13:46, Al Chara wrote:
Try something like:
Windows("Book1.xls").Activate

Change the Window name to whatever you want.

This works when the workbook is saved to .xls

when you save the workbook as template in the XLstart file the name will not be workbook but workbook1 when it's opened
 
Upvote 0
On 2002-04-17 13:46, Al Chara wrote:
Try something like:
Windows("Book1.xls").Activate

Change the Window name to whatever you want.

This works when the workbook is saved to .xls

when you save the workbook as template in the XLstart file the name will not be workbook but workbook1 when it's opened
 
Upvote 0
You can try using AppActivate (probably won't work):

AppActivate "Microsoft Excel - Book1.xlt"
 
Upvote 0
On 2002-04-17 14:21, Al Chara wrote:
You can try using AppActivate (probably won't work):

AppActivate "Microsoft Excel - Book1.xlt"

Tried - but sofar no luck! thanks anyway

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.
 
Upvote 0

Forum statistics

Threads
1,213,531
Messages
6,114,172
Members
448,554
Latest member
Gleisner2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top