Sub Ch2_ProchazeniVrstev()
  ' procházení přes soubor
  On Error Resume Next

  Dim I As Integer
  Dim msg As String
  msg = ""

  For I = 0 To ThisDrawing.Layers.count - 1
    msg = msg + ThisDrawing.Layers.Item(I).Name + vbCrLf
  Next

  MsgBox msg

End Sub