Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Worksheets(2).Activate --> Causes Intermittent Subscript out of Range Error

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,51660
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Worksheets(2).Activate --> Causes Intermittent Subscript out of Range Error
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Worksheets(2).Activate --> Causes Intermittent Subs... - 9/8/2007 2:42:25 AM   
  keithan

 

Posts: 1
Score: 0
Joined: 9/8/2007
Status: offline
Hi all.  New to the forum.  My apologies if this is a redundant post, but I did spend some time looking through previous threads - no joy.

Anyhow, I am intermittently experiencing a subscript out of range error related to the following code:

Worksheets(1).Activate

... spreadsheet manipulations involving only sheet formatting and modifying cell values ...

Worksheets(2).Activate  --> this line seems to cause the error. 

Though it happens sometimes and not others.  Although, the times that it does occur, it seems that i've started my script while worksheet 2 has been already activated.  (e.g., i hit my custom button tied to that macro while on worksheet 2).  but, being on sheet 2 does not always cause the problem.

finally, sheet 2 may be named something other than "Sheet2".  but to my understanding, one should be able to always use the index (i.e. Worksheets(i)).  again though, the error doesn't always occur.

Anyone know why this might be happening?

Keithan
 
 
Post #: 1
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Worksheets(2).Activate --> Causes Intermittent Subscript out of Range Error Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts