Outlook (Word) object hangs when terminating as of Office version 2412

H-Dieter 0 Reputation points
2025-05-08T19:35:25.36+00:00

Good day!

I've encountered an issue when testing in VBA wheter an instance of Outlook (or Word) is available on a PC or not:

Whenever I run the subsequent code using CreateObject while Outlook is not up and running, termination of the Outlook object (objOutlook) by using 'Set objOutlook = Nothing' leads to a grayed-out Outlook icon in the Windows tray which remains there forever. As a matter of fact, you cannot run Outlook anymore until you terminate via task manager.

Dim objOutlook As Object
On Error Resume Next
Set objOutlook = CreateObject("Outlook.Application") ' just for the use case: no Outlook is running already. Full code includes a '
If not (objOutlook is Nothing) AND Err.Number = 0 Then 
	(...do anything in case Outlook is available...)
	objOutlook.Quit
	Set objOutlook = Nothing 
else 
	Msgbox "Error: " & Err.description 
	Err.Clear 
End If

Doing the same with "Word.Application" sporadically leads to left open Word instances which, however won't bug me the same way as the blocking Outlook variant.

This problem occurs on Office 2016 and 2021 from on version 2412 (16.0.18324.20168). It still works with version 2411 (16.0.18227.20162).

It also works well on Microsoft 365.

I have tested with

  • Office 2016 H&B 32-bit with Access 2016 runtime and versions 2411, 2412, 2501, 2502 on Windows 10
  • Office 2021 pro 64-bit with versions 2502 and 2411 on Windows 10
  • Microsoft 365 with versions 2501 and 2502 on Windows 11

So, is this issue known already? Is there any workaround available? Or do I need to wait for bug fix?

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

Your answer

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