How to Fix Excel VBA Error 3265 When Referencing SharePoint List Fields
Question details
A user encounters VBA Error 3265 when trying to insert data into a SharePoint list using an Excel macro. The error triggers when the code references a column with special characters, such as 'Cód. Fornecedor', because neither the visible display name nor the internal SharePoint name matches the actual ADO recordset field name.

- Product
- Microsoft Excel / VBA
- Device & OS
- not provided
- Scenario
- Running an Excel VBA macro that uses ADO to connect to a SharePoint list and update or insert records into a column containing special characters like periods or accents.
- Observed behavior
- The macro throws 'Run-time error 3265: Item cannot be found in the collection corresponding to the requested name or ordinal' because the recordset engine automatically alters the column name during the connection.
Ensure your VBA macro successfully establishes a connection to the SharePoint list and that your ADO recordset object (typically named 'rst') is fully initialized and opened before attempting to read its fields.
Use the VBA Immediate Window to Identify the Real Field Name
Since the OLEDB provider translates certain special characters (like dots) into other characters (like hashes), you must loop through the active recordset to find the exact string the provider expects.
When connecting Excel to a SharePoint list via ADO, column names are sometimes modified if they contain special characters or spaces. Trying to guess the internal name (e.g., C_x00f3_d_x002e_Fornecedor) usually does not work in ADO recordsets. Using the VBA Immediate window allows you to see the actual names the recordset expects.
In your spreadsheet, open the Developer tab and click 'Visual Basic', or press Alt + F11 to launch the VBA editor.
Insert a breakpoint (F9) immediately after the line where your recordset object ('rst') is opened, then run the macro to pause it at that line.
Press Ctrl + G or click the 'View' menu and select 'Immediate Window' to open the debugging pane.
Type 'For Each f In rst.Fields: Debug.Print f.Name: Next' into the Immediate Window and press Enter.
Locate the exact field name printed in the window (for example, 'Cód# Fornecedor') and replace the incorrect field name reference in your VBA macro.

A Lightweight and Compatible Alternative for Your Spreadsheets
Troubleshooting complex SharePoint ADO connections and Excel VBA errors can be extremely time-consuming. If you are looking for a reliable, fast, and highly compatible spreadsheet tool, WPS Office provides an excellent alternative. It supports major Excel formats and features a clean, streamlined user interface for all your data management needs.
- 1. Download WPS Office: Visit the official WPS Office website and download the installation package to your computer.
- 2. Install and Launch: Run the setup file and follow the quick on-screen instructions to install the suite.
- 3. Open Your Spreadsheets: Launch WPS Spreadsheets and open your .xlsm files seamlessly to continue working on your data.

Frequently Asked Questions
What causes Run-time error 3265 in Excel VBA?
Error 3265, 'Item cannot be found in the collection corresponding to the requested name or ordinal', occurs when a specified item (like a column or field name) does not exist in the referenced collection. In SharePoint recordsets, this is usually due to special characters causing a discrepancy between the expected field name and the actual generated name.
Why doesn't the SharePoint internal field name work in ADO VBA?
When VBA accesses a SharePoint list via ADO, the OLEDB provider parses the column names independently of SharePoint's internal naming conventions (e.g., _x0020_). Therefore, neither the display name nor the internal name perfectly matches the parsed name, which often converts dots and spaces into hashes.
How do I clear the VBA Immediate Window?
To clear the VBA Immediate Window, click inside the window, press Ctrl + A to select all the text, and hit the Delete or Backspace key.




