VBA & Macro Problems

Fix Access VBA Error 48 with the Excel Object Library

Huda QurayshiHuda Qurayshi Nov 27, 2026 870 views

Question details

Resolve Access VBA error 48 associated with an Excel object library reference and access open Excel workbooks across Office versions.

Fix Access VBA Error 48 with the Excel Object Library
Product
Microsoft Access VBA and Microsoft Excel
Device & OS
Windows 7 in the reported example
Scenario
An Access database uses an Excel object library reference to count open workbooks, but the installed Office version differs from the referenced version.
Observed behavior
Error 48 occurs when the database references the Excel 16.0 Object Library on a computer running Office 2013, before the procedure executes.
Before you start

Check which versions of Access and Excel are installed using File > Account > About in each application. Open the database in Access and press Alt+F11 to inspect its VBA references.

Solution 1Recommended

Repair the Excel object library reference in Access VBA

Use this approach if the database should continue using an explicit Excel object library reference.

1
Open references

In Access, press Alt+F11, then select Tools > References in the VBA editor.

2
Inspect missing libraries

Look for entries marked MISSING. Clear a broken Excel reference and, if available, select the Microsoft Excel Object Library that matches the installed Excel version.

3
Compile the project

Select OK, then choose Debug > Compile in the VBA editor. Address any remaining missing references or compile errors before running the procedure.

Repair the Excel object library reference in Access VBA
Keep required references: Only remove a reference when it is no longer needed or you can replace it. If the installed Excel library is unavailable or error 48 persists, the Office installation or another DLL dependency may need investigation.
Free Microsoft Office alternative

Work with Excel files in WPS Office

WPS Office is a free, lightweight alternative for everyday spreadsheet work, with a familiar interface and support for common Excel formats to make migration easier. It does not repair Access VBA references or replace Microsoft Access.

Open and edit spreadsheets when working outside AccessCompatible with common Microsoft Excel formats, including XLSX and XLSFamiliar spreadsheet interface for everyday tasksFree, lightweight office suite
microsoft office alternative - wps office

Frequently Asked Questions

Where can I find a missing Excel reference in Access?

Press Alt+F11 in Access, then select Tools > References. Look for a checked entry marked MISSING and replace it with the installed Excel object library if your code needs an explicit reference.

What is the difference between early and late binding?

Early binding uses an explicit Excel object library reference and Excel-specific types. Late binding uses Object variables and resolves Excel members at runtime, avoiding a dependency on a specific Excel library reference.

Does GetObject start Excel if it is closed?

No. GetObject(, "Excel.Application") connects to a running Excel instance and returns an error if one is not available. Open Excel before running the workbook-counting example.

Why does Workbooks.Count need an Excel object in Access?

Workbooks belongs to Excel's application object. In Access, qualify it with the Excel variable, such as oExcel.Workbooks.Count, after connecting to Excel.

What if error 48 continues after I fix the reference?

Compile the project with Debug > Compile and check Tools > References again. Error 48 can also involve another DLL dependency or an Office installation issue, so the Excel reference may not be the only cause.