Removes the specified layer from the current map.
object.Remove ( index ) |
- Index
- Required. A Variant that specifies the name or index of the layer.
index is a variant specifying the layer to remove. It can be either the index or the name of the layer. For example, if your map contains a layer named "Soildata.shp" that has an index of 2, the following two lines of code will yield the same result:
Application.Map.Layers.Remove(2)
Application.Map.Layers.Remove("Soildata.shp")
Application.Map.Layers.Remove(2)
Application.Map.Layers.Remove("Soildata.shp")