VBA & Macro Problems

Fix Excel and Access VBA Error 429 with CurrentProject.Connection

Maira MehtabMaira Mehtab Nov 27, 2026 869 views

Question details

Resolve VBA run-time error 429 when assigning CurrentProject.Connection to an ADODB.Connection variable after an Office upgrade.

Fix Excel and Access VBA Error 429 with CurrentProject.Connection
Product
Microsoft Excel and Microsoft Access VBA
Device & OS
not provided
Scenario
A user runs VBA that connects to an Access database after installing Office 2013 over Office 2010.
Observed behavior
Excel VBA reports run-time error 429 while assigning CurrentProject.Connection to an ADODB.Connection variable.
Before you start

In the VBA editor, identify the exact line highlighted when the error occurs and confirm whether the macro is running in Excel or Access. If connecting from Excel, locate the database file and check whether your Office installation is 32-bit or 64-bit under File > Account > About Excel.

Solution 1Recommended

Create an ADO connection explicitly in Excel VBA

Use this approach when the macro runs in Excel and needs to connect to an Access database.

CurrentProject.Connection belongs to the Access application object model; it is not an Excel connection. In Excel, create an ADODB.Connection and open the database with an appropriate provider.

The example uses late binding, so it does not require an ADO reference. It does require a compatible Access Database Engine provider.

1
Open the VBA editor

In Excel, press Alt+F11, then choose Insert > Module.

2
Create and open the connection

Add this example and replace the path with your database file: Sub ConnectToAccess() Dim cn As Object Set cn = CreateObject("ADODB.Connection") cn.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Data\Example.accdb;" ' Use cn for database operations here. cn.Close Set cn = Nothing End Sub

3
Test the macro

Place the cursor inside ConnectToAccess and press F5. If an error occurs, choose Debug and note whether CreateObject or cn.Open is highlighted.

Create an ADO connection explicitly in Excel VBA
Provider availability: The ACE provider in the example must be installed and compatible with the bitness of Excel. If cn.Open fails, check the provider, database path, and permissions; a provider error is not necessarily error 429.
Free Microsoft Office alternative

Work with Excel files in WPS Office

WPS Office is a free, lightweight Microsoft Office alternative with a familiar interface and compatibility with common Office formats, making it easy to move everyday spreadsheet work. It does not repair Microsoft Office or resolve Access VBA error 429.

Open and edit spreadsheets in a familiar interface.Compatible with Microsoft Excel XLS and XLSX formats.Move everyday Office documents into one lightweight suite.Use a free alternative for routine spreadsheet tasks.
microsoft office alternative - wps office

Frequently Asked Questions

Why doesn't CurrentProject.Connection work directly in Excel?

CurrentProject is part of the Access application object model, not Excel's. In Excel VBA, create an ADODB.Connection and open the database with a suitable connection string, or access the connection through an Access application object.

Do I need to add an ADO reference in VBA?

A reference is needed for early-bound declarations such as ADODB.Connection. In the VBA editor, choose Tools > References and select an available Microsoft ActiveX Data Objects library. Late-bound code using CreateObject("ADODB.Connection") does not require that reference.

How can I check whether Excel is 32-bit or 64-bit?

In Excel, choose File > Account > About Excel and look for the bitness in the version information. The database provider must be compatible with the bitness of the application using it.

Does error 429 always mean Office needs repair?

No. Error 429 indicates an object could not be created, but the cause depends on the failing statement and environment. Check the host application, ADO object creation, references, and required provider before considering an Office repair.