Probleme mit Modulnamen bei VBA-Codegenerierung
26.01.2004 10:21:58
Norbert Stück
Kann ich den Namen ermitteln oder mittels einer Namensprüfung den Abbruch verhindern?
Set wb = ActiveWorkbook.VBProject.VBComponents("DieseArbeitsmappe")
With wb.CodeModule
.InsertLines 3, "
Private Sub Workbook_Open()"
.InsertLines 4, "Dim tabelle As Variant"
.InsertLines 5, "For Each tabelle In Worksheets()"
.InsertLines 6, "If tabelle.ProtectContents = True Then"
.InsertLines 7, "tabelle.EnableAutoFilter = True"
.InsertLines 8, "tabelle.EnableOutlining = True"
.InsertLines 9, "tabelle.Protect contents:=True, userInterfaceOnly:=True"
.InsertLines 10, "End If"
.InsertLines 11, "Next tabelle"
.InsertLines 12, "End Sub
"End With