Private Sub UserForm_Initialize()
Dim intCounter As Integer
For intCounter = 1 To 4
TabStrip1.Tabs(intCounter - 1).Caption = Cells(intCounter, 1)
Next intCounter
End Sub
Private Sub TabStrip1_Change()
Dim sPath As String
Application.ScreenUpdating = False
Application.EnableEvents = False
On Error GoTo ERRORHANDLER
sPath = ThisWorkbook.Path & "\"
If Dir(sPath & TabStrip1.SelectedItem.Caption & ".xls") = "" Then
Beep
MsgBox "Die Datei existiert nicht!"
Exit Sub
End If
Workbooks.Open sPath & TabStrip1.SelectedItem.Caption & ".xls"
With ActiveWorkbook
lblEigenschaften.Caption = "Titel: " & _
.BuiltinDocumentProperties(1) & vbLf & _
"Thema: " & .BuiltinDocumentProperties(2) & vbLf & _
"Autor: " & .BuiltinDocumentProperties(3) & vbLf & _
"Schlüsselworte: " & .BuiltinDocumentProperties(4)
.Close savechanges:=False
End With
ERRORHANDLER:
Application.EnableEvents = True
Application.ScreenUpdating = True
End Sub