Thread: Select a file
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default Select a file

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.