0X800401EB

MK_E_MUSTBOTHERUSER (0x800401EB): Fix When COM Needs Your Input

Windows Errors Intermediate 👁 0 views 📅 May 26, 2026

This error pops up when COM automation needs user input but can't ask. Here's how to stop it fast.

I Know This Error Is Infuriating

You're in the middle of a script or automated task, and then — boom — MK_E_MUSTBOTHERUSER (0x800401EB). It means COM tried to do something that required user input, but nobody was there to click a button. This usually slaps you when you're automating Excel, Outlook, or any Office app from a service or scheduled task on Windows 10 or 11.

Let's kill this thing fast.

The Real Fix: Run the Task Interactively (or Change User Context)

The core problem is simple: COM objects that need user interaction — like Outlook's security prompts or Excel's file dialogs — throw this error when running under a system account or a non-interactive session. Here's the fix that works 90% of the time:

  1. Don't run the script as a service or scheduled task with "Run whether user is logged on or not." That's the biggest trap. Set your task to "Run only when user is logged on." This gives COM a desktop to interact with.
  2. If you must run it headless, change the user context. Use the same user account that's actively logged into the Windows session. Check Task Scheduler: set the task to run as NT AUTHORITY\SYSTEM? Switch it to your domain or local admin account.
  3. For PowerShell or VBScript specifically, add this line at the top to force interactive mode:
    $objShell = New-Object -ComObject Shell.Application
    $objShell.Windows()
    This initializes the shell so COM knows there's a user.

I've seen this error vanish instantly after switching from SYSTEM to a regular admin account. Try that first.

Why This Works: COM's Security Model Is Picky

COM uses a thing called the Impersonation Level. When a script asks for user input, COM checks if the calling thread can impersonate the logged-on user. If it can't — because it's running as SYSTEM or in a non-interactive logon — it throws MK_E_MUSTBOTHERUSER instead of showing a dialog that would hang forever.

It's actually a safety feature. The error is COM saying, "Hey, I can't ask the user because nobody's here, so I'm bailing." Your fix ensures there is a user context available.

Also, this often happens with Outlook's object model guard — that security prompt that asks "A program is trying to access email addresses." That prompt can't appear in a headless session, so you get 0x800401EB. The workaround: use Outlook Redemption or set the Application.ActiveExplorer property before accessing sensitive data.

Less Common Variations and Extra Fixes

Sometimes the standard fix doesn't cut it. Here are the edge cases I've run into:

1. DCOM Permissions Blocking Interactive Access

Open dcomcnfg (Component Services). Go to Component Services > Computers > My Computer > DCOM Config. Find your app (e.g., Microsoft Excel Application). Right-click > Properties > Security tab. Under Launch and Activation Permissions, click Edit. Add your user account with Local Launch and Local Activation permissions.

This one bit me when automating Excel from a web service running under IIS. By default, IIS runs as IUSR or NETWORK SERVICE, neither of which have DCOM launch rights. Adding them fixed it.

2. UAC Interference and Integrity Levels

On Windows 10 with UAC enabled, a script running as admin can't easily talk to a COM object running as a standard user. The integrity levels don't match. Run both at the same privilege level. Either run your script as standard user (no admin), or elevate everything. Mixing levels triggers the error.

I've seen this with PowerShell scripts running as admin but trying to open Excel from a non-elevated Explorer session. The fix: run the script without "Run as administrator."

3. Anti-Virus or Security Software Blocking COM Interaction

Some endpoint protection tools (looking at you, McAfee and Symantec) hook into COM to monitor automation. They can block interactive prompts as "suspicious." Temporarily disable the real-time protection for a test. If the error disappears, add an exception for your script or process.

I had a client whose corporate antivirus outright killed any Outlook automation. After whitelisting the script path, the error never came back.

How to Prevent It from Coming Back

Prevention is about design. If you're building an automation that runs unattended:

  • Avoid COM objects that require user interaction. Use Office's Open XML SDK or Microsoft Graph API instead of Excel or Outlook COM for headless tasks. These don't throw MK_E_MUSTBOTHERUSER because they don't show dialogs.
  • Test in the same user context as production. If it'll run as a scheduled task, test it as that task. Don't test interactively as admin and then expect it to work as SYSTEM — it won't.
  • Use explicit error handling. In PowerShell, wrap your COM calls in a try/catch block and retry after a short delay. Sometimes a transient user context switch can resolve it. Example:
    try {
        $excel = New-Object -ComObject Excel.Application
    } catch [System.Runtime.InteropServices.COMException] {
        if ($_.Exception.ErrorCode -eq 0x800401EB) {
            Write-Host "Need user context — retrying after 2 seconds"
            Start-Sleep -Seconds 2
            $excel = New-Object -ComObject Excel.Application -ErrorAction Stop
        }
    }
  • Set Application.DisplayAlerts = $False in Office automation. This suppresses prompts like "Do you want to save?" — but won't fix security prompts. Works for Excel, not for Outlook's object model guard.

I've been fighting COM errors for years. This one's a classic. The fix is almost always about running your code where a user is sitting. Just give it that, and you'll be fine.

Was this solution helpful?