ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Windows().Activate vs Workbooks().Activate (https://www.excelbanter.com/excel-programming/376798-windows-activate-vs-workbooks-activate.html)

Gary''s Student

Windows().Activate vs Workbooks().Activate
 
If I have tow workbooks open, say Book1 and Book2, I can usually navagate
from Book1 to Book2 with Workbooks("Book2").Activate. Once in a while I need
to do a Windows("Book2.xls").Activate.

What is the difference between the two and which should be used in general?


--
Gary's Student

Tom Ogilvy

Windows().Activate vs Workbooks().Activate
 
You should always use Book2.xls. It should always work. The success
enjoyed when not using the extension is dependent on a windows level setting
- folders setting to hide known extensions.

whether you use windows or workbooks I doubt makes a difference.

--
Regards,
Tom Ogilvy


"Gary''s Student" wrote:

If I have tow workbooks open, say Book1 and Book2, I can usually navagate
from Book1 to Book2 with Workbooks("Book2").Activate. Once in a while I need
to do a Windows("Book2.xls").Activate.

What is the difference between the two and which should be used in general?


--
Gary's Student


Gary''s Student

Windows().Activate vs Workbooks().Activate
 
Thank you.
--
Gary's Student


"Tom Ogilvy" wrote:

You should always use Book2.xls. It should always work. The success
enjoyed when not using the extension is dependent on a windows level setting
- folders setting to hide known extensions.

whether you use windows or workbooks I doubt makes a difference.

--
Regards,
Tom Ogilvy


"Gary''s Student" wrote:

If I have tow workbooks open, say Book1 and Book2, I can usually navagate
from Book1 to Book2 with Workbooks("Book2").Activate. Once in a while I need
to do a Windows("Book2.xls").Activate.

What is the difference between the two and which should be used in general?


--
Gary's Student


Dave Peterson

Windows().Activate vs Workbooks().Activate
 
With a worksheet in book2.xls active, use window|New window.

Then try the "windows("book2.xls").activate" line.



Gary''s Student wrote:

If I have tow workbooks open, say Book1 and Book2, I can usually navagate
from Book1 to Book2 with Workbooks("Book2").Activate. Once in a while I need
to do a Windows("Book2.xls").Activate.

What is the difference between the two and which should be used in general?

--
Gary's Student


--

Dave Peterson

Tom Ogilvy

Windows().Activate vs Workbooks().Activate
 
Dave raises a good point about a workbook being able to have multiple windows.

I personally always use workbooks rather than windows.

--
Regards,
Tom Ogilvy


"Gary''s Student" wrote:

Thank you.
--
Gary's Student


"Tom Ogilvy" wrote:

You should always use Book2.xls. It should always work. The success
enjoyed when not using the extension is dependent on a windows level setting
- folders setting to hide known extensions.

whether you use windows or workbooks I doubt makes a difference.

--
Regards,
Tom Ogilvy


"Gary''s Student" wrote:

If I have tow workbooks open, say Book1 and Book2, I can usually navagate
from Book1 to Book2 with Workbooks("Book2").Activate. Once in a while I need
to do a Windows("Book2.xls").Activate.

What is the difference between the two and which should be used in general?


--
Gary's Student



All times are GMT +1. The time now is 04:29 PM.

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