Link to home
Start Free TrialLog in
Avatar of Jagwarman
Jagwarman

asked on

make an open workbook an active workbook

can an expert provide me with the vba code to make an open workbook an active workbook.

So, I am in a workbook [lets call it ABC] that has a macro. this workbook needs to refer to another [open] workbook [Lets call that XYZ]

So ABC needs to switch between ABC and XYZ and back from time to time throughout the Macro Process. I thinking that rather than refer to ABC and XYZ I should refer to ThisWorkbook and ????? [XYZ as ??Workbook]

Thanks
Avatar of Ken Butters
Ken Butters
Flag of United States of America image

Question: When you have the two workbooks open... are they running in separate instances of Excel or in the same instance?    

The answer to your question will be quite a bit different if you need to reach across instances of excel.

If the workbooks are in the same instance of excel, then you will only be able to see workbooks one at a time in the same window.

If the workbooks are in different instances of excel, then you can have the both open at the same time in different windows.
Avatar of Jagwarman
Jagwarman

ASKER

Hi ken.

Always in the same instance

Regards
ASKER CERTIFIED SOLUTION
Avatar of nutsch
nutsch
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
both excellent thanks