README Checked Out Files #
Overview #
Lists SharePoint files currently checked out to the signed-in user by calling the Microsoft Graph Search API (POST /search/query) with the KQL query IsCheckedoutToMe:true. Authentication is via OAuth2 with MFA support using VBAuth.dll. This is a single API call that searches across all SharePoint sites and OneDrive for Business the user has access to, returning up to 25 results. Each result includes the filename, last modified date and by whom, file size, and direct URL to the file.
Note: this uses a different endpoint pattern from other VBAuth features. The Graph Search API takes a POST with a JSON body containing a requests array, and returns results in a nested structure (value[0].hitsContainers[0].hits[n].resource). Response parsing uses JSONConverter throughout.
Office apps #
- Access (tested M365)
- Excel (untested M365)
Required components #
- VBAuth.dll v1.x
- modVBAuthGlobalConstants.bas (from /shared)
- modCheckedOutFiles.bas (this module)
Azure Entra App Registration #
Delegated permissions:
- Files.Read.All
VBAuth Admin Table – Required Values #
| Column Name | Required Value / Example | Notes |
|---|---|---|
| AppID | 16 | Identifies this feature’s configuration record |
| ActionName | VBAuth – Checked Out Files | Display name — any value acceptable |
| ClientID | (your App Client ID) | GUID from Azure App Registration Overview blade |
| TenantID | (your Tenant ID) | GUID from Azure App Registration Overview blade |
| ObjectID | (your Object ID) | Set by PopulateMissingObjectIDs |
| ScopeClaims | Files.Read.All | Comma-separated Graph scopes |
| Verb | POST | HTTP method — Graph Search API uses POST |
| URLPart1 | https://graph.microsoft.com/v1.0/search/query | Graph Search API endpoint |
| URLParameter1 | NO VALUE REQUIRED | Not used |
| URLPart2 | NO VALUE REQUIRED | Not used |
| URLParameter2 | NO VALUE REQUIRED | Not used |
| URLPart3 | NO VALUE REQUIRED | Not used |
| WaitForLogin | 60 | Seconds — NB MSXML2 timeout parameters are in milliseconds |
Module: modCheckedOutFiles.bas #
Public functions #
Public Function GetCheckedOutFiles( _
ByRef strResult As String, _
ByRef lngCount As Long, _
ByRef strMessage As String) As Boolean
Code language: JavaScript (javascript)
Sets AppID=16, acquires a bearer token for Files.Read, POSTs the KQL search query to the Graph Search API, and parses the response. Returns True on HTTP 200. strResult receives a formatted multi-line list of checked-out files. lngCount receives the count. strMessage receives a summary on success or an error description on failure.
Private functions #
BuildSearchPayload()— constructs the POST body withIsCheckedoutToMe:trueKQL,entityTypes: ["driveItem"],from: 0,size: 25.SafeString(objItem, strKey)— returns a string field from a parsed JSON object, returning""if the field is absent.
Behaviour #
- Runs as the signed-in user (delegated permissions only).
- HTTP 200 is the success code. This endpoint always returns 200 even for zero results — the count in
hitsContainers.totaldistinguishes empty results. - Results are capped at 25 by the
sizeparameter in the request. IfmoreResultsAvailableis true the display note says “showing first 25”. - Searches across all SharePoint sites and OneDrive for Business the user has access to — not limited to a single site.
- The user must check in or discard checkout of files from SharePoint directly; this tab is read-only.
- Authentication is interactive on first run; subsequent calls within the session reuse the cached token.
- HTTP timeouts use the standard
lngHTTPTimeoutconstant.
Notes #
- No application permissions are supported — this must run as a delegated (user) call.
Files.Read.Allis required —Files.Readonly covers the user’s own OneDrive and is insufficient for SharePoint content across sites.- Admin consent is required before users can authenticate if your tenant has consent policies in place.
- The Graph Search API uses POST not GET — the URL stored in URLPart1 is the full endpoint with no appended query string.
- The
IsCheckedoutToMe:trueKQL filter is a SharePoint-specific managed property and is not documented prominently in the main Graph Search API docs. It works reliably in v1.0. - Files checked out in OneDrive Personal are not returned — only SharePoint and OneDrive for Business.
VBAuth, developed and maintained by Andrew Richards (The IT Service Ltd) and Peter Bryant (Corylus Business Systems), © 2025–2026. All rights reserved. https://vbauth.com