You can't use the "Freeze" method on the current layer. Change the line "objlayer.Freeze = False" to: If objLayer.Name <> ThisDrawing.ActiveLayer.Name Then objLayer.Freeze = False