ThisCalculator

Everyday

Excel: How to Delete the Current Workbook File

Updated · Standard formula, shown below

Excel: How to Delete the Current Workbook File

To delete the current workbook file in Excel, you must close the file first—Excel does not allow you to delete a file that is open. After closing it, you can delete the file from File Explorer (Windows) or Finder (Mac), or use Excel’s Save As dialog to overwrite it with a new file. This article explains the exact steps, what happens to your data, and how to avoid common mistakes.

Why Excel Won’t Let You Delete an Open Workbook

Excel locks any file that is currently open. This is a safety feature to prevent you from accidentally deleting a file you are actively working on, which would cause data loss. The lock is enforced by the operating system: when a file is open, the system marks it as “in use,� and deletion attempts are blocked with an error like “The action can’t be completed because the file is open in Excel.�

This applies to all versions of Excel on Windows and Mac. Even if you have unsaved changes, Excel holds a lock on the file from the moment you open it until you close it. The only exception is if you are working with a file that is stored in a cloud location (like OneDrive or SharePoint) and you delete it from the web interface—but that is not the same as deleting from within Excel.

How to Delete the Current Workbook (Step-by-Step)

Here is the standard process for deleting the workbook you are currently viewing:

  1. Save any changes you want to keep. If you delete the file, you cannot recover those changes later.
  2. Close the workbook by clicking File > Close, or by pressing Ctrl+W (Windows) or Cmd+W (Mac). If you have unsaved changes, Excel will prompt you to save or discard them.
  3. Navigate to the file’s location using File Explorer (Windows) or Finder (Mac). You can find the path by going to File > Info in Excel before closing—it shows the full folder path.
  4. Select the file and press the Delete key (Windows) or Cmd+Delete (Mac). Alternatively, right-click the file and choose “Delete� from the context menu.
  5. Confirm the deletion if prompted. On Windows, the file moves to the Recycle Bin; on Mac, it moves to the Trash. You can restore it from there if you change your mind.

If you want to delete the file permanently without sending it to the Recycle Bin, hold Shift while pressing Delete on Windows. On Mac, hold Option+Cmd+Delete. Be careful—this bypasses the trash and cannot be undone.

Alternative: Overwrite the File with Save As

If your goal is to replace the current workbook with a new one (perhaps a blank template or a cleaned-up version), you can use the Save As feature to overwrite it:

  1. Create the new workbook you want to keep.
  2. Click File > Save As.
  3. Choose the same folder and enter the same filename as the old workbook.
  4. Click Save. Excel will ask if you want to replace the existing file—confirm yes.

This effectively deletes the old file and replaces it with the new one. However, this only works if the old file is not open in another Excel window. If it is, you will get a “file in use� error.

Common Problems and How to Fix Them

Even after closing the workbook, you might encounter issues when trying to delete it:

  • “File in use� error persists: Sometimes Excel keeps a hidden lock on the file, especially if you closed the window but the process is still running. Open Task Manager (Ctrl+Shift+Esc on Windows) and end any Excel processes, then try again.
  • File is read-only: If the file has read-only attributes, you cannot delete it normally. Right-click the file, choose Properties, and uncheck “Read-only� before deleting.
  • File is stored in a cloud folder: If the file is synced to OneDrive or SharePoint, deleting it locally may also delete it from the cloud. You might see a warning—read it carefully.
  • You don’t have permission: On a shared computer or network drive, you may need administrator rights to delete a file. Contact the system administrator.

What Happens to the Data in the Deleted Workbook?

When you delete a workbook, the file is removed from its folder. On Windows, it goes to the Recycle Bin; on Mac, to the Trash. You can restore it by opening the Recycle Bin/Trash, right-clicking the file, and choosing “Restore.� This is the safest way to delete because you have a second chance.

If you empty the Recycle Bin or Trash, the file is permanently erased and cannot be recovered through normal means. If you need to recover a permanently deleted file, you would need specialized recovery software, but success is not guaranteed—especially if the disk space has been overwritten.

Note that deleting the file does not remove any data that was copied to other locations, such as a backup drive or a cloud sync. If you have backups enabled (like File History or Time Machine), you may still have a copy.

Deleting the Current Workbook vs. Deleting a Sheet

A common confusion is between deleting the entire workbook file and deleting a worksheet within the workbook. They are very different:

  • Delete a worksheet: Right-click the sheet tab at the bottom of Excel and choose “Delete.� This removes the sheet from the workbook, but the file itself remains.
  • Delete the workbook file: This removes the entire .xlsx (or .xls) file from your disk, including all sheets.

If you want to remove all data from a workbook but keep the file, you can delete all sheets except one, then clear the remaining sheet. Alternatively, create a new blank workbook and use Save As to overwrite the old file.

Safety Tips and Best Practices

Before you delete any Excel file, consider these points:

  • Check for backups: If the file contains important data, ensure you have a backup (e.g., in cloud storage or an external drive) before deleting.
  • Close all Excel windows: Make sure no other Excel window has the same file open. You can check by looking at the taskbar or using Task Manager.
  • Use the Recycle Bin/Trash: Deleting to the Recycle Bin gives you a safety net. Avoid permanent deletion unless you are absolutely sure.
  • Be cautious with cloud-synced files: Deleting a file that is synced to OneDrive or SharePoint will delete it from all devices. If you only want to remove it locally, you may need to disable sync first.

Frequently Asked Questions

Can I delete the current workbook without closing it?

No. Excel locks the file while it is open, and the operating system will not allow deletion. You must close the workbook first, then delete the file from File Explorer or Finder.

What if I delete a workbook by mistake?

If you deleted it to the Recycle Bin or Trash, you can restore it by right-clicking the file and choosing “Restore.� If you emptied the trash, you would need file recovery software, but it may not work if the disk space has been overwritten.

Does deleting the workbook also delete my formulas and data?

Yes. The entire file is removed, including all sheets, formulas, and data. If you need to keep any of that, make a backup before deleting.

How do I delete a workbook that is open in another Excel window?

Close that other window first. If you cannot find it, open Task Manager (Ctrl+Shift+Esc) and end all Excel processes, then try deleting again.

Can I delete a workbook from within Excel?

No, Excel does not have a built-in command to delete the current file. You must use the operating system’s file manager. The only exception is if you are using a cloud-based version (Excel Online) where you can delete the file from the web interface.

What is the difference between deleting a file and removing it from the Recycle Bin?

Deleting a file moves it to the Recycle Bin (Windows) or Trash (Mac). Removing it from the Recycle Bin permanently erases it. Until you empty the bin, you can restore the file.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.