How to Fix Excel “Temp File” Bloat causing Disk Full Errors

When Excel displays a “Disk is full” error while saving a small file, or when your primary drive suddenly runs out of free space, orphan temporary files are filling your storage. During normal operation, Excel writes changes to hidden temporary swap files and deletes them once the save completes. If Excel crashes, if a cloud sync client locks the swap file, or if an antivirus scanner intercepts the save, these temporary files are left behind, quickly consuming gigabytes of disk space.

Fast Fix

Close all Excel windows. Press Windows Key + R, type %temp%, and hit Enter. Press Ctrl + A, then Shift + Delete to permanently remove all files. Next, delete any stranded .tmp or .xar files located in %appdata%\Microsoft\Excel. This immediately frees your disk space and clears the save block.


Diagnostic Snapshot

SymptomFile Name PatternRoot Cause
Saving fails with “Disk is full” on a small document~DF*.tmp or *.tmp in %temp%Excel failed to complete an atomic save; temporary swap files accumulated over time.
Thousands of hidden files in the document folder~WRL*.tmp or ~$filename.xlsxAntivirus or cloud sync locked the temporary file before Excel could swap and delete it.
Hard drive drops to 0 MB free during big workbook sessionsMultiple gigabyte-sized files in TempLarge binary model or Power Query cache failed to release memory to disk.
Temp folder fills up inside a corporate VDI sessionC:\Users\Username\AppData\Local\TempUser Profile Disk (UPD) size limit reached; cleanup scripts are failing on logoff.

How Excel Saves Files (The Atomic Save Process)

Excel does not write directly over your existing file when you click Save. Doing so would destroy your original file if your computer lost power or crashed mid-write. Instead, Excel uses a three-step atomic save process:

1. Write New Data
   Excel creates a hidden temporary file with a randomized name:
   "~DF1A2B.tmp" in the target directory or %temp%.

2. Rename Original
   Excel renames the original file to a backup name:
   "Report.xlsx" ──► "~Report.xlsx.tmp"

3. Complete the Swap
   Excel renames the temporary file to the final name:
   "~DF1A2B.tmp" ──► "Report.xlsx"
   Excel deletes the temporary backup file: "~Report.xlsx.tmp"

If a background tool (such as OneDrive, SharePoint Sync, Dropbox, or an endpoint security agent) inspects ~DF1A2B.tmp while Step 3 is running, Windows places a file lock on it. Excel cannot complete the swap, reports that the disk is full, and leaves the .tmp file behind. Over weeks of edits, these orphan files multiply and consume your entire drive.


Step-by-Step Resolution

Step 1: Purge User and System Temp Directories

  1. Ensure Excel is completely closed. Check Task Manager (Ctrl + Shift + Esc) to make sure no EXCEL.EXE background tasks remain.
  2. Press Windows Key + R, type %temp%, and press Enter. This opens your user temp folder (AppData\Local\Temp).
  3. Press Ctrl + A to select all files.
  4. Press Shift + Delete and click Yes to bypass the Recycle Bin.
  5. If Windows flags any files as “In Use,” check Do this for all current items and click Skip.
  6. Next, press Windows Key + R, type C:\Windows\Temp, and press Enter.
  7. Delete all unneeded files in this directory as well (administrator approval required).

Step 2: Clean the Excel AutoRecover and Unsaved Workbooks Cache

Excel stores disaster recovery snapshots in designated application folders. When workbooks crash repeatedly, these snapshots are never cleared.

  1. Press Windows Key + R, paste the following path, and click OK:
    %appdata%\Microsoft\Excel
  2. Look for folders named after your workbooks containing files with .xar extensions.
  3. Delete folders for projects you are no longer working on.
  4. Check the unsaved files directory:
    %localappdata%\Microsoft\Office\UnsavedFiles
  5. Delete any abandoned .asd or .xar files you do not need.

Step 3: Prevent Cloud Sync and Antivirus File-Lock Collisions

If temporary files keep appearing in the same directory where your workbooks are stored, your sync engine is locking files during saves.

  1. OneDrive / SharePoint:
    • Right-click the OneDrive cloud icon in your system tray and select the Gear icon > Settings.
    • Go to the Sync and backup tab and click Advanced settings.
    • Under File collaboration, ensure Office applications sync Office files is properly configured. If OneDrive constantly triggers “Upload blocked” loops that drop .tmp files, follow How to Fix “Excel is not responding” when Opening Large Binary (.xlsb) Files.
  2. Antivirus Exclusions:
    • Configure your corporate endpoint scanner or Windows Defender to exclude temporary file patterns created by Microsoft Office (.tmp, ~*.tmp, ~$*.xlsx).
    • This ensures security tools will not lock files during Excel’s three-step save process.

Step 4: Automate Disk Maintenance via Windows Storage Sense

Prevent temp file bloat from building up again by setting Windows to clean temporary folders automatically.

  1. Open Windows Settings (Windows Key + I).
  2. Go to System > Storage.
  3. Toggle Storage Sense to On.
  4. Click on Storage Sense to configure cleanup rules:
    • Check Keep Windows running smoothly by automatically cleaning up temporary system and app files.
    • Under User content cleanup, turn on Automatic User content cleanup.
    • Set Delete temporary files that my apps aren’t using to 1 day or 14 days.

Hard Stops and Escalation

  • Virtual Desktop Infrastructure (VDI) Disk Full Warnings: In Citrix or Azure Virtual Desktop environments, temporary files can fill up the virtual profile disk (often limited to 30 GB or 50 GB). If clearing %temp% only frees space temporarily, contact your IT administrator to expand your User Profile Disk allocation or enable logoff temp-clearing policies.
  • Out of Resources on Free Drives: If Excel reports “Disk is full” when your hard drive has hundreds of gigabytes of free space, the issue is not drive storage. The file is hitting Excel’s internal 2 GB memory ceiling or the 64k formatting limit. For troubleshooting steps, see How to Resolve “There isn’t enough memory to complete this action”.