Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
hmm hmm is offline
external usenet poster
 
Posts: 175
Default Select a file

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   Report Post  
Posted to microsoft.public.excel.programming
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.

  #3   Report Post  
Posted to microsoft.public.excel.programming
hmm hmm is offline
external usenet poster
 
Posts: 175
Default Select a file

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Select file. Tom Excel Programming 1 April 19th 05 10:06 AM
open file dialog-select file-import worksheet Divinedar Excel Programming 1 January 16th 04 07:13 PM
Prompt user to select file with default file selected dialog Bruce Cooley Excel Programming 0 September 15th 03 06:43 AM
Prompt user to select file with default file selected dialog Bob Phillips[_5_] Excel Programming 0 September 14th 03 09:22 PM
Prompt user to select file with default file selected dialog Bob Phillips[_5_] Excel Programming 0 September 14th 03 09:19 PM


All times are GMT +1. The time now is 02:12 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"