没有添加错误转向语句,怎么能够处理错误。

- Public Function CreateLayer(ssLayerName As String) As AcadLayer
- [color=#DC143C]on error resume next[/color]
- Set CreateLayer = ThisDrawing.Layers(ssLayerName)
- If Err Then
- Err.Clear
- Set CreateLayer = ThisDrawing.Layers.Add(ssLayerName)
- End If
- End Function
|