IsThere1_SPWB

Checks if a workbook is found in a SharePoint location or not, giving a full http workbook path.
This can also be used to see if current user has access to that SharePoint location/file or not.
The check happens by trying to open that workbook, that is why you need to make sure that you close that workbook if no longer needed bu passing ThenClose parameter.


Public

Tested

My Own Work
Function IsThere1_SPWB(Workbook_URL, Optional ThenClose = 1)
   ' Checks if sharepoint spreadsheet is found or not
   Dim Wbbb As Workbook
   OldDisplayAll = Application.DisplayAlerts
   Application.DisplayAlerts = False
   On Error Resume Next
   Err.Clear
   Set Wbbb = Workbooks.Open(Workbook_URL, False)
   If Err.Number <> 0 Then
      IsThere1_SPWB = False
   Else
      If ThenClose = 1 Then Wbbb.Close False
      IsThere1_SPWB = True
   End If
   Application.DisplayAlerts = OldDisplayAll
End Function

Workbook_URL, Optional ThenClose = 1

Views 418 Downloads 122

VBA-Excel Sessions
ANmarAmdeen
755
Attachments
Revisions

v1.0