I have written the following code for checking-in of files through VBA on Sharepoint.
Dim strWkbCheckIn As String
strWkbCheckIn = spBASE_URL + spDOC_LIB + "/" + spFILE_NAME
' Determine if workbook can be checked in.
If Workbooks(strWkbCheckIn).CanCheckIn = True Then
Workbooks(strWkbCheckIn).CheckIn
MsgBox ("checked in.")
Else
MsgBox ("This file cannot be checked in ")
End If
But it is showing the following error:
Run-time error '9':
Subscript out of range
I have already checked that the file does exist on the sharepoint. But still getting this error. Just a wild guess, is it possible, that since the file and checked-out to me, it is not visible to the program?