LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Dennis
 
Posts: n/a
Default Subscript out of range ... sometimes! (Same code unpredictable re

XL 2003

The file Test.txt is in memory but I want it to be the active sheet
therefore I attempt to execute:

....
Dim UpdateFileName as String
....
UpdateFileName = "Test.xls" 'shown just as example
Windows(UpdateFileName).Activate
....

Sometimes I get "Subscript out of range" error other times not.

Results of major frustrating investigation:

I noted that when the filename only (i.e. Test.xls) in on an XL Tab on the
(Win XP) task bar, all is OK.

When the path is included with the filename on an XL Tab on the XP Task bar
I get the error.

Further, if I use the XL file open wizard - I do NOT get the error. That
said, if I load Test.xls by double clicking Test.xls from Windows Explorer
AND it is the first use in the day of that file on the startup of XL - the
path shows on the Tab AND I get the error.

Therefore, having the path on the Win XP Task bar Tab = error

I or we may never know why, but does anyone know how to change my code to
avoid the error?

Dennis
 
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
How do I create a schedule from a list of dates ? Gavin Morris Charts and Charting in Excel 2 October 28th 10 04:08 PM
VBA code error with Protection turned on - help please Fred Excel Discussion (Misc queries) 1 March 17th 06 04:06 PM
Macro for changing text to Proper Case JPriest Excel Worksheet Functions 3 August 8th 05 09:31 PM
Code to select range Shawn Excel Discussion (Misc queries) 1 June 2nd 05 05:14 PM
Opening a file with code without a set file name jenkinspat Excel Discussion (Misc queries) 1 March 3rd 05 03:40 PM


All times are GMT +1. The time now is 04:56 AM.

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"