Gruppe
Datei
Problem
Wie kann ich in einem vorgegebenen Verzeichnis bei allen ExcelArbeitsmappen die Stichwort-Eigenschaft festlegen?
StandardModule: basMain
Sub SetProperties()
Dim iCounter As Integer
Application.ScreenUpdating = False
Application.EnableEvents = False
On Error GoTo ERRORHANDLER
With Application.FileSearch
.LookIn = Range("B1").Value
.FileType = msoFileTypeExcelWorkbooks
.FileName = "*.xls"
.Execute
For iCounter = 1 To .FoundFiles.Count
Workbooks.Open _
FileName:=.FoundFiles(iCounter), _
updatelinks:=False
ActiveWorkbook.BuiltinDocumentProperties(4) = _
"Excel, VBA"
ActiveWorkbook.Close Savechanges:=True
Next iCounter
End With
ERRORHANDLER:
Application.EnableEvents = True
Application.ScreenUpdating = False
End Sub