ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to Active Window (https://www.excelbanter.com/excel-programming/393243-how-active-window.html)

maperalia

How to Active Window
 
I want to know how can I active a window. I have the statement written (see
below) ,however, it is not working. The "Progname" is already open with
another files and I want the "Progname" to be the active one when the macro
is done.

Thanks advance.
Maperalia

"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
Progname = "S:\GEOTEST\shears\" & WO & "\" & Boring & " " & "@" & " " &
depth & ".xls"
Windows(Progname).Activate


JLGWhiz

How to Active Window
 
Workbooks(Progname).Activate

"maperalia" wrote:

I want to know how can I active a window. I have the statement written (see
below) ,however, it is not working. The "Progname" is already open with
another files and I want the "Progname" to be the active one when the macro
is done.

Thanks advance.
Maperalia

"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
Progname = "S:\GEOTEST\shears\" & WO & "\" & Boring & " " & "@" & " " &
depth & ".xls"
Windows(Progname).Activate


maperalia

How to Active Window
 
LGWhiz;
Thanks for the quick response. I put the statement you gave me (
Workbooks(Progname).Activate ) a I got the following error message:

Run-Time error'9':
Subscript out of range

What does it mean?

Maperlia


"JLGWhiz" wrote:

Workbooks(Progname).Activate

"maperalia" wrote:

I want to know how can I active a window. I have the statement written (see
below) ,however, it is not working. The "Progname" is already open with
another files and I want the "Progname" to be the active one when the macro
is done.

Thanks advance.
Maperalia

"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
Progname = "S:\GEOTEST\shears\" & WO & "\" & Boring & " " & "@" & " " &
depth & ".xls"
Windows(Progname).Activate


Chip Pearson

How to Active Window
 
Run-Time error'9':
Subscript out of range

What does it mean?


That means that there is no window with a caption equal to the contents of
the 'Progname' variable.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)

"maperalia" wrote in message
...
LGWhiz;
Thanks for the quick response. I put the statement you gave me (
Workbooks(Progname).Activate ) a I got the following error message:

Run-Time error'9':
Subscript out of range

What does it mean?

Maperlia


"JLGWhiz" wrote:

Workbooks(Progname).Activate

"maperalia" wrote:

I want to know how can I active a window. I have the statement written
(see
below) ,however, it is not working. The "Progname" is already open with
another files and I want the "Progname" to be the active one when the
macro
is done.

Thanks advance.
Maperalia

"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
Progname = "S:\GEOTEST\shears\" & WO & "\" & Boring & " " & "@" & " " &
depth & ".xls"
Windows(Progname).Activate



maperalia

How to Active Window
 
Chip'
Thanks for your response.
Could you please lead me to solve it?

Thanks.
Maperalia

"Chip Pearson" wrote:

Run-Time error'9':
Subscript out of range

What does it mean?


That means that there is no window with a caption equal to the contents of
the 'Progname' variable.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)

"maperalia" wrote in message
...
LGWhiz;
Thanks for the quick response. I put the statement you gave me (
Workbooks(Progname).Activate ) a I got the following error message:

Run-Time error'9':
Subscript out of range

What does it mean?

Maperlia


"JLGWhiz" wrote:

Workbooks(Progname).Activate

"maperalia" wrote:

I want to know how can I active a window. I have the statement written
(see
below) ,however, it is not working. The "Progname" is already open with
another files and I want the "Progname" to be the active one when the
macro
is done.

Thanks advance.
Maperalia

"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
Progname = "S:\GEOTEST\shears\" & WO & "\" & Boring & " " & "@" & " " &
depth & ".xls"
Windows(Progname).Activate



maperalia

How to Active Window
 
Chip;
Thanks very much I got it. Basically I followed your advice that "there is
no window with a caption equal to the contents of the 'Progname' variable".
Therefore, I typed the the following content instead:
"" & WO & "\" & Boring & " " & "@" & " " & depth & ".xls"
and it is working perfectly.
Thanks again for your help.

Maperalia






"Chip Pearson" wrote:

Run-Time error'9':
Subscript out of range

What does it mean?


That means that there is no window with a caption equal to the contents of
the 'Progname' variable.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)

"maperalia" wrote in message
...
LGWhiz;
Thanks for the quick response. I put the statement you gave me (
Workbooks(Progname).Activate ) a I got the following error message:

Run-Time error'9':
Subscript out of range

What does it mean?

Maperlia


"JLGWhiz" wrote:

Workbooks(Progname).Activate

"maperalia" wrote:

I want to know how can I active a window. I have the statement written
(see
below) ,however, it is not working. The "Progname" is already open with
another files and I want the "Progname" to be the active one when the
macro
is done.

Thanks advance.
Maperalia

"$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
Progname = "S:\GEOTEST\shears\" & WO & "\" & Boring & " " & "@" & " " &
depth & ".xls"
Windows(Progname).Activate




All times are GMT +1. The time now is 03:31 PM.

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