ich versuche ein Excel-File aus dem Sharepoint auszuschecken, zu bearbeiten und speichern und wieder einzuchecken. Ich benutze folgenden Code und bekomme immer "Run-time error '9': Subscript out of range" Fehler in folgenden Zeile
If Workbooks(str_FilePath).CanCheckIn = True Then
Verstehe leider nicht, was ich hier falsch mache :(
Viele Dank im Voraus für Eure Zeit und Hilfe!
Viele Grüße,
Dre
Sub file_checkOutIn()
Dim str_FilePath As String
str_FilePath = "https://LINK"
If Workbooks.CanCheckOut(str_FilePath) = True Then
Workbooks.CheckOut str_FilePath
Application.DisplayAlerts = False
Workbooks.Open str_FilePath
Application.DisplayAlerts = True
Else
MsgBox "You are unable to check out this document"
End If
If Workbooks(str_FilePath).CanCheckIn = True Then
Workbooks(str_FilePath).CheckInWithVersion True, , True
Else
MsgBox "This file cannot be checked in " & _
"at this time. Please try again later."
End If
Exit Sub
End Sub