Option Explicit
' ****************************************************************
' Autor/en und Original-Quelltext unter:
' https://www.online-vba.de/vba_laufzeit.php
' Verwendung der Quelltexte auf eigene Gefahr!
' Es gelten die Nutzungsbedingungen von https://www.online-vba.de
' ****************************************************************
Public Sub OVBAde_VBA_Zur_Laufzeit_Aendern()
Dim i As Long, j As Long
For i = 1 To Application.VBE.VBProjects.Count
If Application.VBE.VBProjects.Item(i).Name = "MeinVBAProjekt" Then
For j = 1 To Application.VBE.VBProjects.Item(i).VBComponents.Count
If Application.VBE.VBProjects.Item(i).VBComponents.Item(j).Name = "DieseArbeitsmappe" Then
With Application.VBE.VBProjects.Item(i).VBComponents.Item(j)
.CodeModule.InsertLines 141, "'Nur eine Kommentarzeile in Zeile 141 einfügen"
.CodeModule.DeleteLines 134, 1 'Zeile 134 wird gelöscht
End With
End If
Next j
End If
Next i
End Sub