Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Subscript out of range error
Hi
I am trying to open a file and do some operation on it. I am using the following statement in my code - strMetricsFile = ActiveWorkbook.FullName While Trim(Workbooks(strMetricsFile).ActiveSheet.Range(" A" & intCurrentRowMetrics).Value) < "" I am getting an error message - Subscript out of range If I use the File name directly in the above statement instead of strMetricsFile, the code runs fine. But if I use the variable instead of the file name, it gives me the error. Can anyone please help ! Thanks Vishal |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Subscript out of range error
I would guess it should be
strMetricsFile = ActiveWorkbook.Name While Trim(Workbooks(strMetricsFile).ActiveSheet.Range(" A" & intCurrentRowMetrics).Value) < "" -- HTH Bob Phillips (remove nothere from email address if mailing direct) "Vishal" wrote in message oups.com... Hi I am trying to open a file and do some operation on it. I am using the following statement in my code - strMetricsFile = ActiveWorkbook.FullName While Trim(Workbooks(strMetricsFile).ActiveSheet.Range(" A" & intCurrentRowMetrics).Value) < "" I am getting an error message - Subscript out of range If I use the File name directly in the above statement instead of strMetricsFile, the code runs fine. But if I use the variable instead of the file name, it gives me the error. Can anyone please help ! Thanks Vishal |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Subscript out of range error
thanks !
it worked. Now I am facing a different problem. The macro runs fine on my machine. But when I execute it on some other machine, I get an error message- "Can't fine project or library" ! Any suggestions ? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Subscript out of range error
Sounds like you have a referenced library that is not on that machine. Go to
ToolsReferences in the VBIDE and see what is missing. -- HTH Bob Phillips (remove nothere from email address if mailing direct) "Vishal" wrote in message oups.com... thanks ! it worked. Now I am facing a different problem. The macro runs fine on my machine. But when I execute it on some other machine, I get an error message- "Can't fine project or library" ! Any suggestions ? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Subscript out of range error | Excel Discussion (Misc queries) | |||
Type Mismatch error & subscript out of range error | Excel Programming | |||
subscript out of range error | Excel Programming | |||
Subscript Out Of Range Error? | Excel Programming | |||
Subscript out of range error | Excel Programming |