Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I want to select a file and close it. But when execution reaches the line:
Windows("Scope1.txt").Activate I get the error message: Subscript out of range (Error 9). The same command worked for an .xls file earlier in the program. Perhaps the command is coded differently for a text file? Appreciate anyone's help in how to do this. Thanks. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If scope1.txt is the workbook name, then try using
Workbooks("Scope1.txt).Activate -- Regards, Tom Ogilvy "hmm" wrote: I want to select a file and close it. But when execution reaches the line: Windows("Scope1.txt").Activate I get the error message: Subscript out of range (Error 9). The same command worked for an .xls file earlier in the program. Perhaps the command is coded differently for a text file? Appreciate anyone's help in how to do this. Thanks. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks Tom; it worked! (See separate post for the next question arising.)
"Tom Ogilvy" wrote: If scope1.txt is the workbook name, then try using Workbooks("Scope1.txt).Activate -- Regards, Tom Ogilvy "hmm" wrote: I want to select a file and close it. But when execution reaches the line: Windows("Scope1.txt").Activate I get the error message: Subscript out of range (Error 9). The same command worked for an .xls file earlier in the program. Perhaps the command is coded differently for a text file? Appreciate anyone's help in how to do this. Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Select file. | Excel Programming | |||
open file dialog-select file-import worksheet | Excel Programming | |||
Prompt user to select file with default file selected dialog | Excel Programming | |||
Prompt user to select file with default file selected dialog | Excel Programming | |||
Prompt user to select file with default file selected dialog | Excel Programming |