README List My Channels

README List My Channels #

What this does #

Lists all Teams channels visible to the signed-in user, grouped by Team, using two sequential Microsoft Graph API calls authenticated via OAuth2 with MFA through VBAuth. The first call retrieves the list of Teams the user has joined; the second call retrieves the channel list for each Team in turn. Each channel is shown with its display name and membership type (standard, private, or shared).

Office apps #

  • Access (tested M365)
  • Excel (untested M365)

Required components #

  • VBAuth.dll v1.x
  • modVBAuthGlobalConstants.bas (from /shared)
  • modListMyChannels.bas (this module)

Azure Entra App Registration #

One app registration is shared by both lclVBAuthAdmin records.

Delegated permissions:

  • Team.ReadBasic.All
  • Channel.ReadBasic.All

Admin consent is not required in standard tenants. If your tenant restricts user consent, grant admin consent in the Azure portal before users authenticate.

VBAuth Admin Table — Required Values #

AppID=10 — GET /me/joinedTeams #

Column NameRequired Value / ExampleNotes
AppID10Identifies this feature’s configuration record (Joined Teams)
ActionNameVBAuth – List My Channels (Joined Teams)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 — shared registration with AppID=11
ScopeClaimsTeam.ReadBasic.All,Channel.ReadBasic.AllComma-separated Graph scopes — shared registration with AppID=11
VerbGETHTTP method
URLPart1https://graph.microsoft.com/v1.0/me/joinedTeamsGraph endpoint
URLParameter1NO VALUE REQUIREDNot used
URLPart2NO VALUE REQUIREDNot used
URLParameter2NO VALUE REQUIREDNot used
URLPart3NO VALUE REQUIREDNot used
WaitForLogin60Seconds — NB MSXML2 timeout parameters are in milliseconds

AppID=11 — GET /teams/{id}/channels #

Column NameRequired Value / ExampleNotes
AppID11Identifies this feature’s configuration record (Get Channels per Team)
ActionNameVBAuth – List My Channels (Channels)Display name — any value acceptable
ClientID(your App Client ID)GUID from Azure App Registration Overview blade — same registration as AppID=10
TenantID(your Tenant ID)GUID from Azure App Registration Overview blade — same as AppID=10
ObjectID(your Object ID)Set by PopulateMissingObjectIDs — same as AppID=10
ScopeClaimsTeam.ReadBasic.All,Channel.ReadBasic.AllComma-separated Graph scopes — shared registration with AppID=10
VerbGETHTTP method
URLPart1https://graph.microsoft.com/v1.0/teams/Base endpoint — team ID appended at runtime
URLParameter1Team ID from AppID=10 responseGUID — passed as strParam1 to SetEntraAPPIdValues at runtime
URLPart2/channelsAppended after URLParameter1
URLParameter2NO VALUE REQUIREDNot used
URLPart3NO VALUE REQUIREDNot used
WaitForLogin60Seconds — NB MSXML2 timeout parameters are in milliseconds

At runtime, SetEntraAPPIdValues(False, False, strTeamID, "") assembles: https://graph.microsoft.com/v1.0/teams/{strTeamID}/channels

Module: modListMyChannels.bas #

Public functions #

Public Function ListMyChannels(ByRef strMessage As String,
                               Optional objStatusBox As Object = Nothing) As Boolean
Code language: JavaScript (javascript)

Retrieves all channels for all of the signed-in user’s joined Teams. objStatusBox is an optional reference to a text box control; if supplied, progress messages are written to it during the call via DoEvents. Pass Nothing (or omit the argument) if no live progress display is needed. Returns True on success with a formatted plain-text listing in strMessage. Returns False on any failure with an error description in strMessage. Individual Teams where the channel call fails are listed with an inline note rather than aborting the whole operation.

Private functions #

ParseJsonArray(strJson As String) As String() — extracts a zero-based array of JSON object strings from a "value":[...] block. Self-contained; does not use JSONConverter.bas.

ExtractJsonString(strJson As String, strKey As String) As String — returns the string value of a named key from a JSON object. Returns “” if absent or null.

Behaviour #

  • All API calls run as the signed-in user (delegated permissions — no application permissions)
  • HTTP 200 is the success code for both GET calls
  • The bearer token acquired for AppID=10 is reused for all AppID=11 calls via the token cache; the user is prompted to sign in once only
  • Teams where the HTTP call returns non-200 are noted inline in the output; the remaining Teams are still processed
  • HTTP timeouts use lngHTTPTimeout from modVBAuthGlobalConstants for all four timeout parameters
  • Interactive sign-in is required on first use or after token expiry

Notes #

  • No application permissions are used or required
  • Team.ReadBasic.All returns id and displayName reliably; other team properties may be null in the joinedTeams response
  • Channel membershipType may be absent for standard channels; the module defaults to “standard” in that case
  • Both lclVBAuthAdmin records must have identical ClientID, TenantID and ScopeClaims for token caching to work correctly
  • The Configure button writes ClientID, ObjectID and TenantID to both AppID=10 and AppID=11 in one operation

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

Updated on April 3, 2026