Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Subscript out of range error

The following line of code results "subscript out of range error" on some
machines (other pc-s work just fine with the same code). All computers have
Windows XP and Excel XP.

---
G = Workbooks("hex_ee_converter.xls").Worksheets("Main ").Range("A35").Value
---

The workbook hex_ee_converter.xls exists and is open when this error message
occurs. The worksheet Main also exists and is open. The cell A35 also exists
and contains value 2.

What should I do to get rid of this error message?

enz


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Subscript out of range error

If you replace Range("A35") with Cells("A35) (or Cells
(1,35) then that should work.


-----Original Message-----
The following line of code results "subscript out of

range error" on some
machines (other pc-s work just fine with the same code).

All computers have
Windows XP and Excel XP.

---
G = Workbooks("hex_ee_converter.xls").Worksheets

("Main").Range("A35").Value
---

The workbook hex_ee_converter.xls exists and is open when

this error message
occurs. The worksheet Main also exists and is open. The

cell A35 also exists
and contains value 2.

What should I do to get rid of this error message?

enz


.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 340
Default Subscript out of range error

It sounds like the workbook or worksheet may not truly be open. Try the
following statements just before the error line:

msgbox Workbooks("hex_ee_converter.xls").Name
msgbox Workbooks("hex_ee_converter.xls").Worksheets("Main ").Name

If one of the above generates an error, it narrows the problem to either the
workbook or the worksheet

Bob Flanagan
Macro Systems
http://www.add-ins.com
Productivity add-ins and downloadable books on VB macros for Excel



"enz" wrote in message
...
The following line of code results "subscript out of range error" on some
machines (other pc-s work just fine with the same code). All computers

have
Windows XP and Excel XP.

---
G =

Workbooks("hex_ee_converter.xls").Worksheets("Main ").Range("A35").Value
---

The workbook hex_ee_converter.xls exists and is open when this error

message
occurs. The worksheet Main also exists and is open. The cell A35 also

exists
and contains value 2.

What should I do to get rid of this error message?

enz




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Subscript out of range error

Problem solved. The ".xls" extension was missing from the filename.

enz


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
Error:Subscript out of range Jay Excel Discussion (Misc queries) 1 April 10th 08 10:25 PM
Subscript out of range error moglione1 Excel Discussion (Misc queries) 2 August 30th 05 01:21 PM
Subscript out of range error Tom Ogilvy Excel Programming 0 December 10th 03 12:48 AM
Help on subscript out of range error (VB6/VBA) farmer[_2_] Excel Programming 2 November 2nd 03 04:19 PM
Subscript out of range error Chris M.[_3_] Excel Programming 1 August 27th 03 05:03 PM


All times are GMT +1. The time now is 05:39 PM.

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

About Us

"It's about Microsoft Excel"