Message 1 of 3
"Key not found" error
Not applicable
10-23-2008
03:49 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
When I run the code below I get this error:
Run-time error '-2145386476 (80200012)':
Key not found
with an "OK" button and a "Help" button. The help button does literally
nothing when clicked and the OK button just makes the dialog go away,
nothing more. Here's the code:
-------------------------------------------------------
Sub FixLayers()
Dim MyLayers As AcadLayers
Dim myLayer As AcadLayer
Set MyLayers = ThisDrawing.Layers
For Each myLayer In MyLayers
Set myLayer = ThisDrawing.Layers(Name)
With myLayer
Select Case UCase(Name)
Case "S-COCO"
.Name = "S-CONC-COLS"
Case "S-WACO"
.Name = "S-CONC-WALL"
Case "S-DIM"
.Name = "S-ANNO-DIMS"
Case Else
Debug.Print "Old Layer Name Not Found"
End Select
End With
Next
End Sub
-------------------------------------------------------
--
matthew g.
"...take my world all apart, take it now, take it now,
and serve the ones that I despise, speak the words I can't deny..."
-- Dan Haseltine
Run-time error '-2145386476 (80200012)':
Key not found
with an "OK" button and a "Help" button. The help button does literally
nothing when clicked and the OK button just makes the dialog go away,
nothing more. Here's the code:
-------------------------------------------------------
Sub FixLayers()
Dim MyLayers As AcadLayers
Dim myLayer As AcadLayer
Set MyLayers = ThisDrawing.Layers
For Each myLayer In MyLayers
Set myLayer = ThisDrawing.Layers(Name)
With myLayer
Select Case UCase(Name)
Case "S-COCO"
.Name = "S-CONC-COLS"
Case "S-WACO"
.Name = "S-CONC-WALL"
Case "S-DIM"
.Name = "S-ANNO-DIMS"
Case Else
Debug.Print "Old Layer Name Not Found"
End Select
End With
Next
End Sub
-------------------------------------------------------
--
matthew g.
"...take my world all apart, take it now, take it now,
and serve the ones that I despise, speak the words I can't deny..."
-- Dan Haseltine