Update SharePoint multi choice field programmatically

Tom Weir (CONTSBW) 40 Reputation points
2025-10-09T22:56:50.41+00:00

Need help with updating a multi-choice field in a SharePoint List using VBA. Key points:

  • I'm using an ADODB.connection object to update a SharePoint list. I am successful opening the connection, building the necessary SQL Update command and running connection.execute.
  • All fields of interest update successfully except the multiple-choice fields.
  • The current format of the update command looks like
    SQL= "UPDATE [" & Name & "] SET " & values$ & " WHERE [ID]=' " & Key$ & "';"
  • values$ is in the form [Field1]='value1', [Field2]='value2', etc.
  • For the multi-choice field, the format looks like [MultichoiceField] = ';#Item1;#Item2;'.
  • Connection = "Provider=Microsoft.ACE.OLEDB.12.0;WSS;IMEX=2;RetrieveIds=No;DATABASE=" & Path$ & ";LIST=" & Name & ";"

Note: This is the same format that I get the data when I download those fields using the same ADODB.connection. Only difference is that for the download, I'm opening a recordset and using the recorset.getrows function to dump the SharePoint list data to a variable for processing.

Developer technologies | Visual Basic for Applications
0 comments No comments
{count} votes

Answer accepted by question author
  1. Varsha Dundigalla(INFOSYS LIMITED) 3,725 Reputation points Microsoft External Staff
    2025-10-10T11:19:42.9+00:00

    Thank you for reaching out.

    It looks like you’re running into a common challenge when updating SharePoint multi-choice fields through VBA and ADO. The issue happens because these fields are stored in a special internal format in SharePoint. The “;#” format that you see when reading data works for displaying it, but it doesn’t work the same way when writing back.

    Here are a few approaches you can try:

     Use a Recordset to update instead of a SQL command

    Rather than using a direct SQL UPDATE statement, it’s more reliable to open the list as a recordset and update the values through it. This method handles the SharePoint data format automatically and avoids formatting errors that often occur with direct SQL updates.

    Adjust your connection settings

    When performing updates, make sure your connection string allows editing. You can do this by setting it to use an update-friendly mode — for example, changing your IMEX and RetrieveIds options. This helps ADO recognize your list items correctly.

    Check your field type and name

    Ensure that the field you’re updating is a “Choice” field that allows multiple selections, not a Lookup field. Also, double-check the internal name of the field in SharePoint, as that’s what ADO uses for updates.

    If recordset updates still don’t work

    You can consider using SharePoint’s REST API or Microsoft Graph API from VBA. These allow you to send update requests directly to SharePoint and fully support multi-choice fields. It’s a bit more advanced, but it gives reliable results once set up.

     Tip: Start with the recordset approach it’s the most straightforward and works for most SharePoint setups.

     If you continue to face issues after trying this, please share what error or behavior you see, and we can guide you step by step.

     Let me know if you need any further help with this. We'll be happy to assist.

    If you find this helpful, please mark this as answered.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.