Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Error in 2003 which is not in 2000
Please help.
When I type the following code and run in excel 2003, I get error "subscript out of range" runtime error 9. This is not there for the same code in 2000. How to resolve this. Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim tmpWB As Workbook Set tmpWB = Workbooks.Open("C:\Program Files\General Electric\DFSS Process\Databases9.14.98\208.Face-Centered_CCD.table", 0, True, 2) Dim tmpSheet As New Worksheet Dim s As String s = Left("208.Face-Centered_CCD.table", 31) MsgBox s Set tmpSheet = Sheets(Left("208.Face-Centered_CCD.table", 31)) MsgBox tmpSheet.Name End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Error in 2003 which is not in 2000
You apparently don't have a worksheet with the name
208.Face-Centered_CCD.table Perhaps it has a space on the end or something. also, why do you try to take the leftmost 31 characters from a string of length 27? -- Regards, Tom Ogilvy "Laks" wrote in message ... Please help. When I type the following code and run in excel 2003, I get error "subscript out of range" runtime error 9. This is not there for the same code in 2000. How to resolve this. Private Sub Worksheet_SelectionChange(ByVal Target As Range) Dim tmpWB As Workbook Set tmpWB = Workbooks.Open("C:\Program Files\General Electric\DFSS Process\Databases9.14.98\208.Face-Centered_CCD.table", 0, True, 2) Dim tmpSheet As New Worksheet Dim s As String s = Left("208.Face-Centered_CCD.table", 31) MsgBox s Set tmpSheet = Sheets(Left("208.Face-Centered_CCD.table", 31)) MsgBox tmpSheet.Name End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Strange 'protected cell' error affecting Excel 2003 but not Excel 2000? | Excel Discussion (Misc queries) | |||
Pie chart built in 2000, now in 2003 but unable to edit 2003-way | Excel Discussion (Misc queries) | |||
Error Checking Options - 2000-2003 | Excel Discussion (Misc queries) | |||
Macro error after switching from Excel 2000 to Excel 2003 | Excel Discussion (Misc queries) | |||
#VALUE! error: vlookup works in Excel 2000 but not 2003 | Excel Discussion (Misc queries) |