Fix CO_E_CANCEL_DISABLED (0x80010140) on Windows
Tired of this COM error stopping your app? Here's the direct fix and why it works. No fluff.
Yeah, that 0x80010140 error is annoying. It usually shows up when you're trying to run a script or an automation tool (like a PowerShell script or a VBA macro in Office) and it just bombs out with "Call Cancellation is disabled." The COM call fails because something's blocking the cancellation mechanism. Let's fix it.
The Short Fix: Adjust DCOM Call Cancellation Settings
This error happens when a COM component has its call cancellation policy set too restrictively. The standard fix is to change a registry key. Here's exactly how.
- Press Windows Key + R, type
regedit, and hit Enter. Say Yes to the UAC prompt. - Go to this key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Ole\AppCompat - If the AppCompat key doesn't exist, right-click the
Olefolder, choose New > Key, and name itAppCompat. - Inside AppCompat, right-click in the right pane, choose New > DWORD (32-bit) Value.
- Name it
EnableCallCancellation. - Double-click that new DWORD, set the Value data to
1, and click OK. - Close Regedit and restart your computer.
After the restart, try your script or macro again. The error should be gone.
Note: If you're on a 64-bit system and the COM app is 32-bit, you also need to set this same DWORD in the 32-bit registry path:
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Ole\AppCompat
Why This Works
COM+ has a call cancellation feature that lets one component cancel a call another component is making. This is useful for shutting down hung operations. But some apps or scripts don't handle cancellation well — they throw this error instead of just ignoring the cancellation request.
The EnableCallCancellation DWORD set to 1 tells the COM layer to allow cancellation to work. Without it, the COM system refuses the call entirely, and you get 0x80010140. This is a known issue with older COM components (like those from Office 2010 or certain third-party automation libraries).
Less Common Variations of the Same Issue
1. The DCOM Launch Permissions Are Too Strict
Sometimes the error shows up because the COM server doesn't have permission to start. This is rarer, but worth checking if the registry fix didn't help.
- Open Component Services: press Windows Key + R, type
dcomcnfg, hit Enter. - Expand Component Services > Computers > My Computer > DCOM Config.
- Find the COM component that's failing (it might be listed by AppID — match it to the AppID in the error details).
- Right-click it, choose Properties.
- Go to the Security tab. Under Launch and Activation Permissions, check if the user running the script has access.
- If not, click Edit, add your user account, and give it Local Launch and Local Activation permissions.
- Click OK all the way out, then restart the app or script.
2. Antivirus or Security Software Blocking COM Calls
Some aggressive security tools (looking at you, certain enterprise AV suites) hook into COM and block cancellation calls. If the registry fix didn't work, temporarily disable your antivirus (disconnect from the internet first) and test. If the error disappears, add an exception for the specific application or COM object in your AV settings.
3. Corrupted COM Registration
If you recently reinstalled an app that uses COM (like an Office suite), the registration might be botched. Re-register all COM components with a command prompt as Administrator:
regsvr32 /i /s %windir%\system32\ole32.dll
regsvr32 /i /s %windir%\system32\oleaut32.dll
Then restart. This reinitializes the core COM libraries. It's a long shot, but I've seen it work twice.
How to Prevent This Error in the Future
Prevention is straightforward. Do these three things:
- Keep COM components updated. If you use Office automation, install the latest Office service packs and updates. Microsoft fixed many cancellation bugs in later versions.
- Run your scripts as the same user who installed the app. COM permissions are often tied to user accounts. Don't run an automation script under SYSTEM if the app was installed by a user.
- Use the registry fix as a proactive measure. Set
EnableCallCancellationto 1 before you even see the error. It doesn't hurt anything, and it prevents the error from ever appearing.
That's it. You should be back up and running. If the error still shows up after all this, check the Windows Event Viewer under Applications and Services Logs > Microsoft > Windows > COM+ for more specific error details. Usually, that log will tell you exactly which AppID is failing.
Was this solution helpful?