ich habe ein Makro das alle vorhandenen Makros ausliest und auflistet:
Sub MakroListe()
'verweis microstoft visual basic for applications extensibility muß aktiv sein
Dim objVBA As Object
Dim c As Long, r As Long, i As Long, Anfang As Long, Ende As Long
Dim strCode As String
Cells.Clear
For Each objVBA In ActiveWorkbook.VBProject.VBComponents
If objVBA.Type = _
vbext_ct_ClassModule Or _
vbext_ct_Document Or _
vbext_ct_StdModule Then
r = 1
c = c + 1
Cells(r, c) = objVBA.Name
Cells(r, c).Font.Bold = True
With objVBA.CodeModule
For i = 1 To .CountOfLines
If .ProcOfLine(i, vbext_pk_Proc) > "" Then
strCode = .ProcOfLine(i, vbext_pk_Proc)
If strCode <> Cells(r, c) Then
r = r + 1
Cells(r, c) = strCode
End If
End If
Next i
End With
End If
Next
Cells.Columns.AutoFit
End Sub
Das hat auch immer funktioniert.
Jetzt kommt die Fehlermeldung: 1004: Der programmatische Zugriff auf das Visual Basic-Projekt ist nicht sicher.
Wo liegt der Fehler?
Danke Lars