How to Check if Outlook is Installed Before Sending Email from Access VBA
Question details
The user needs a method to verify whether Microsoft Outlook is installed and available before executing VBA code to send emails from Microsoft Access.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Automating email delivery through Microsoft Access using late binding, which fails if Outlook is missing.
- Observed behavior
- The Access application throws VBA error -2147418113 (Class not registered) and crashes when attempting to create the Outlook.Application object on systems where Outlook is not installed, unavailable, or improperly registered.
Ensure you have access to the VBA Integrated Development Environment (IDE) in your Microsoft Access database and understand how to navigate to the module containing your email automation code.
Use a VBA Error Handler for Late Binding
Implement an inline error handler to safely attempt creating the Outlook object, catching the runtime error gracefully if the application is missing.
When using late binding, Access relies on the Windows Registry to launch external applications. By intentionally bypassing the default error halt, you can test if the object creation is successful and display a friendly message or switch to an alternative email method (like SMTP) if Outlook is unavailable.
In your Microsoft Access database, press ALT + F11 to open the Visual Basic for Applications (VBA) editor.
Find the function or subroutine where you automate your email sending.
Right before the line that creates the Outlook object, add the statement: On Error Resume Next.
Execute the late binding command: Set objOutlook = CreateObject("Outlook.Application").
Immediately after creation, check the error code by adding: If Err.Number <> 0 Then. If true, Outlook is not installed or available.
Inside the If block, alert the user with a message box, clear the error using Err.Clear, and exit the routine safely. Remember to add On Error GoTo 0 afterwards to restore normal error handling.

Looking for a Lightweight Alternative for Your Daily Office Work?
While complex database automation is handled in Microsoft Access, you can seamlessly manage your standard spreadsheets, documents, and presentations using WPS Office. It is highly compatible with Microsoft formats and requires a fraction of the system resources.
- 1. Visit the Website: Go to the official WPS Office website to find the correct version for your device.
- 2. Download the Installer: Click the Free Download button and save the installer to your computer.
- 3. Install and Start: Run the installer, follow the simple setup steps, and open WPS Office to handle your daily tasks.

Frequently Asked Questions
Does clearing the VBA error with Err.Clear prevent Access from crashing completely?
Clearing the error with Err.Clear resets the error object for that specific block of code, stopping the immediate VBA runtime halt. However, it does not prevent Access from crashing if subsequent unhandled errors occur or if the core application encounters deeper instability.
Why do I get a Class not registered error when Outlook is definitely installed?
The -2147418113 VBA error can still occur if your Outlook installation is corrupted, the Windows Registry entries are incorrect, or there is a bitness mismatch between your programs (for example, attempting to automate a 64-bit Outlook installation from 32-bit Access).
Can I use early binding to check if Outlook is installed instead?
Early binding is not recommended for environments where Outlook might be missing. It requires a direct reference to the Outlook Object Library. If the library is missing on the user's computer, the database project will fail to compile and throw 'Missing Reference' errors before the code even runs.




