Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 12-29-2005, 11:17 AM
rnstewart rnstewart is offline
Novice
Mysterious "Subscript out of range" error
 
Join Date: Nov 2005
Posts: 6
rnstewart
Default Mysterious "Subscript out of range" error

I have a VBA application I've developed, and one line of code works fine on my computer but refuses to work on another.



The code in question is designed to read the value of a particular cell of the spreadsheet that contains the app. It looks like this:

Code:
If (Workbooks("FileConvert.xls").Worksheets("Sheet1").Range("B1").Value <> "") Then
I.e., "Look at this workbook (named 'FileConvert.xls'), get the value from Cell B1 in sheet 'Sheet1' and see if it is empty".

On my machine, this works fine. On the other one, it throws a "Subscript out of range" error. Both computers are running Excel 2002. I also tried referencing the sheet by index instead of name (i.e., "Worksheets(1)" instead of "Worksheets("Sheet1")").

Any ideas what could be going wrong here? It seems like a simple enough command.
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mysterious &quot;Subscript out of range&quot; error MYOB and "Item.Send error" Outlook message peter_lambros Outlook 1 12-06-2008 08:24 AM
Excel error: "Too many different cell formats" enviroko Excel 0 01-09-2008 07:27 AM
"IF" "THEN" statements in Macros mfgeng_iss Misc 0 10-04-2007 07:31 AM
"open" or "open using" option not availa ccd Outlook 0 09-22-2006 01:23 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:22 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft