0X80040065

DVTARGETDEVICE Error 0x80040065: Fix the Invalid DV_E_ Structure

That 0x80040065 error means a program passed Windows a busted DVTARGETDEVICE structure. Usually it's a corrupt printer driver or a bad clipboard payload. Here's the fix.

You double-click a document, hit Print, and instead of a job in the queue you get a dialog that says something like "Invalid DVTARGETDEVICE structure" with the hex code 0x80040065. Sometimes it shows up in a design app when you paste something. Sometimes it pops from an OLE automation script that's been running fine for months.

The code itself is DV_E_DVTARGETDEVICE, one of the OLE structured-storage errors. In plain English: some piece of software handed Windows a DVTARGETDEVICE structure that Windows refused to read. That structure describes which target device (usually a printer) a chunk of data was rendered for. When it's malformed, missing, or points at a device that no longer exists, you get this error and the operation dies on the spot.

I've hit this on everything from Windows 7 machines with legacy label printers to a Windows 11 box last month where a client's HP driver update replaced the print processor and shredded every OLE-based print call. The trigger is almost always the printer driver or the clipboard. Let's fix it in that order.

Cause 1: Corrupt or mismatched printer driver (most common)

Nine times out of ten, this is the one. Windows builds a DVTARGETDEVICE from the printer's DEVMODE when an app prepares print data. If the driver returns garbage — mismatched architecture, half-installed, or leftover from a Windows upgrade — the structure comes out invalid and OLE rejects it with 0x80040065.

Real scenario: a client upgraded from Windows 10 to Windows 11 in place. Their old Ricoh driver carried over, but the print processor got swapped during the upgrade. Every Word document printed fine to PDF but errored out to the physical printer. Reinstalling the driver from scratch (not an update — a clean install) fixed it in ten minutes.

Step-by-step fix

  1. Open Settings → Bluetooth & devices → Printers & scanners (Windows 11) or Devices → Printers & scanners (Windows 10).
  2. Click the printer that's throwing the error, then Remove device. Confirm.
  3. Go to Print Management (run printmanagement.msc). Delete any leftover driver packages for that printer under both Drivers and Print Servers → [your PC] → Drivers.
  4. Reboot before reinstalling — yes, actually reboot. Half the time Windows caches the old spooler state and reinstalling without a reboot just re-registers the same broken DEVMODE.
  5. Download the current driver directly from the manufacturer. Skip Windows Update's auto-pick — it hands out generic drivers that often trigger this exact error with OLE print paths.
  6. Install it. If the vendor offers a "clean install" or "remove previous versions" checkbox, tick it.

If the printer is a network printer on a print server, repeat the same removal on the server, then reconnect the client.

Cause 2: A poisoned clipboard payload

The DVTARGETDEVICE structure also lives in clipboard data. When you copy rich content — a chart from Excel, a range from a PDF viewer, an embedded object from a CAD app — the source app stuffs a target-device descriptor into the clipboard format. If that descriptor references a printer that's since been deleted or renamed, the receiving app chokes when it tries to paste.

Had a user last week whose Excel workbook would throw 0x80040065 the second they copied a formatted range into Outlook. Turned out they'd deleted their old Dymo label printer months earlier. The clipboard still had the Dymo device name cached from an old print-preview copy. Clearing the clipboard killed the error instantly.

Step-by-step fix

  1. Save your open work — this is going to wipe the clipboard.
  2. Open an elevated command prompt (Win + X → Terminal (Admin)).
  3. Run cmd /c "echo off | clip" to flush the clipboard, or simply open Notepad and press Ctrl + V then delete nothing — the paste itself clears the OLE descriptor.
  4. Restart Explorer so the shell re-initializes its clipboard cache:
taskkill /f /im explorer.exe
start explorer.exe

If the error keeps coming back every time you paste from the same source app, the source is the culprit. Check that app's default printer setting in File → Print Setup — if it points at a device that's no longer installed, point it at Microsoft Print to PDF or a real, current printer.

Cause 3: System file or OLE registration damage

Rare, but real. If ole32.dll, oleaut32.dll, or the COM registration entries for the structured-storage subsystem get corrupted — usually after a botched update, a half-uninstalled program, or malware cleanup that nuked registry keys indiscriminately — you'll get 0x80040065 on basically any OLE operation, not just printing or pasting.

You'll know it's this cause because the error follows you everywhere. Notepad is fine, but Word, Excel, Outlook, and any app that touches the clipboard or print pipeline all break.

Step-by-step fix

  1. Run System File Checker from an admin prompt:
sfc /scannow
  1. If SFC finds nothing fixable, run DISM to repair the component store it draws from:
DISM /Online /Cleanup-Image /RestoreHealth
  1. Re-register the OLE DLLs (the DISM pass usually does this, but if not):
regsvr32 ole32.dll
regsvr32 oleaut32.dll
regsvr32 propsys.dll
  1. Reboot. Test with a simple copy-paste from Word to Word first, then try printing.

If that doesn't clear it, run a Windows repair upgrade — mount the current Windows ISO, run setup.exe from the desktop, and choose Keep files and apps. Takes an hour and rebuilds every system binary without touching your data. I've used this twice in the last year on machines where DISM couldn't recover, and both times it ended the error permanently.

Quick reference

Symptom Likely cause Fastest fix
Error only when printing to one specific printer Corrupt printer driver Remove printer + driver, reboot, clean install from vendor
Error when pasting rich content between apps Stale clipboard DVTARGETDEVICE Clear clipboard, restart explorer.exe, reset source app default printer
Error in every OLE app, not just printing System file / OLE registration damage sfc /scannow, then DISM RestoreHealth, then repair upgrade
Error after a Windows feature upgrade Legacy driver carried over Delete and reinstall every printer driver post-upgrade

One thing worth saying out loud: don't chase registry cleaners or "OLE repair" utilities for this. I've watched a client's machine go from one broken printer driver to a completely unusable Office install after they ran one of those tools. Stick to the driver, the clipboard, and DISM. Those cover basically every 0x80040065 you'll ever see.

Related Errors in Windows Errors
0XC01D0006 0XC01D0006 Monitor Serial Number Error – Fixed 0XC0220005 0xC0220005: Provider Not Found – Two Fixes That Work 0X0000089C Fix 0X0000089C: Logon Processor Alias Error 0XC0000019 STATUS_NOT_MAPPED_VIEW 0XC0000019: Fix for Unmap Error in Windows

Was this solution helpful?

EP
Erropedia Team
Tech Support Editors
The Erropedia editorial team researches and documents real-world tech errors from across Windows, Linux, macOS, networking, databases, cloud platforms, and more. Every solution is reviewed for accuracy and updated as software and systems evolve.