Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
Subscript out of range error
Problem solved. The ".xls" extension was missing from the filename.
enz |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Error:Subscript out of range | Excel Discussion (Misc queries) | |||
Subscript out of range error | Excel Discussion (Misc queries) | |||
Subscript out of range error | Excel Programming | |||
Help on subscript out of range error (VB6/VBA) | Excel Programming | |||
Subscript out of range error | Excel Programming |