Yes, you can recover an Excel file that was opened directly from an Outlook attachment. The primary method requires you to locate the temporary file stored by Microsoft Office on your computer, as the original file may have been saved in a different location, deleted, or the original attachment may no longer be in your inbox. This process works on Windows desktop versions of Microsoft Office and Outlook, and the file recovery relies on the temporary files that Office creates when you open an attachment.

What You'll Need

  • A computer running Windows (this guide applies to Windows 10 and 11).
  • A version of Microsoft Office that includes Outlook (e.g., Office 365, Office 2019, Office 2016).
  • The file name of the Excel workbook you were working on.
  • Approximately 5 to 10 minutes of time to search for and rename the temporary file.

Step-by-Step

  1. Locate the Temporary Files Folder. You will need to navigate to the user profile's AppData folder where Office stores temporary data. This folder is hidden by default, so you must turn on the option to view hidden files first. In the File Explorer address bar at the top, type %temp% and press Enter. This will open the temporary files folder. While this folder contains many unrelated files, the one you need is likely named with a long random string followed by ~$ and the original filename.
  2. Sort the List by Name. Once the folder is open, you need to scan the list of files to find your specific Excel file. The easiest way to do this is to sort the files by Name. Click the "Name" column header in the top of the window. This will order the files alphabetically, placing files starting with ~$ at the very top of the list. This is the section where your temporary file will be.
  3. Verify the File Name. Carefully examine the files at the top of the list. Look for a filename that matches the name of the Excel file you were working on. The temporary file will have the exact same name as your original file, but it will be preceded by a tilde (~$). For example, if you were working on a file named "Budget 2023.xlsx", the temporary file will be named "~$Budget 2023.xlsx". The temporary file will have an extension of .xlsx (or .xls if it is an older format), not .tmp.
  4. Copy the Temporary File. Once you have identified the correct temporary file, you need to copy it to a safe location. Right-click on the ~$Budget 2023.xlsx file and select "Copy" from the context menu. Alternatively, you can left-click once to select the file and then press Ctrl+C on your keyboard. This copies the file to your clipboard.
  5. Create a New Folder for Recovery. To prevent accidental overwriting or confusion, it is best to create a dedicated folder for your recovered file. On your desktop, right-click and select "New" > "Folder". Name this folder something descriptive, such as "Recovered Excel Files" or "Budget Recovery". Double-click to open this new folder.
  6. Paste the File. Inside the new folder you created, right-click on the empty space and select "Paste" from the context menu. Alternatively, you can press Ctrl+V on your keyboard. This will create a copy of the temporary file in your new folder. The file will likely still have the ~$ prefix in its name. For example, it will be named "~$Budget 2023.xlsx".
  7. Remove the Tilde Prefix. The file is now recovered, but it is not yet ready to be used. It still has the ~$ prefix, which indicates it is a temporary file. To make it usable, you must remove the tilde and the dollar sign. Right-click on the file and select "Rename" from the context menu. Alternatively, you can press F2 on your keyboard. Select the entire filename, including the ~$ prefix, and delete it. Type the new, clean name for your file, such as "Budget 2023.xlsx". Press Enter to save the change.
  8. Open the Recovered File. Navigate to your new folder and double-click the file with the clean name. It should open in Microsoft Excel without any issues. You can now review the contents, save it to your desired location, and continue your work.

Important Note on Saving: When you are finished working with the recovered file, make sure to save it to a permanent location, such as your Documents folder or a network drive. Do not rely on the temporary folder for long-term storage. You can also use the "Save As" function to create a backup copy of the file in a different location.

Common Mistakes

  • Opening the File from the Email Client Directly: The most common mistake is assuming that the file you have open in Outlook is the one that was saved. When you open an attachment in Outlook, it is often opened in a temporary read-only mode or a mode that does not prompt for a save location. This means the file is not being saved to your hard drive, and if you close the email, the file may be lost. The recovery process requires locating the temporary file that Office created in the background when you opened the attachment.
  • Waiting Too Long: Temporary files are not permanent. If you restart your computer, run a disk cleanup utility, or simply wait a long period of time, the temporary file may be deleted by the operating system. It is important to perform this recovery process as soon as possible after you realize you have lost the file.
  • Confusing the File Name: It is easy to confuse files with similar names. For instance, if you have a file named "Budget 2023.xlsx" and another named "Budget 2023_v2.xlsx", you might accidentally recover the temporary file for the wrong document. Always carefully compare the file name, including the ~$ prefix, with the name of the file you were working on.
  • Assuming the File is Corrupted: Sometimes a file that appears to be corrupted is actually just a temporary file. The ~$ prefix is a clear indicator that the file is a temporary file. If you see this prefix, you should assume the file is not the final version and proceed with the renaming process.

Tips

  • Check the "Recent" Files List: After you have recovered the file using the temporary file method, check the "Recent" list in the Excel application. If the file was opened recently, it may appear in this list. You can right-click on the file in the "Recent" list and select "Open File Location" to see where the file is currently stored. This can be a quick way to find the file if you have already saved it.
  • Use a File Recovery Tool: If you are unable to find the temporary file using the method described above, you can use a file recovery tool. These tools are designed to scan your hard drive for deleted files and can often recover files that have been permanently deleted. However, these tools are not always free, and they may not be able to recover all files.
  • Enable AutoRecover: To prevent data loss in the future, it is a good idea to enable the AutoRecover feature in Microsoft Office. This feature automatically saves your work at regular intervals, even if you forget to save. To check if this feature is enabled, go to File > Options > Save. Ensure that the "Enable AutoRecover after X minutes" option is checked.
  • Save Attachments to Disk: The most effective way to avoid this problem in the future is to always save Outlook attachments to your computer before opening them. This ensures that the file is stored in a permanent location and that you have a copy of the file even if you lose access to the email.

Troubleshooting

If you have followed the steps above and are still unable to recover your Excel file, or if the recovered file appears to be empty or corrupted, try the following troubleshooting steps.

Check the File Extension: The temporary file must have the same extension as the original Excel file. If you are looking for a file named "Budget 2023.xlsx" but the temporary file is named "~$Budget 2023.tmp", it is likely that the file is not an Excel temporary file. This can happen if the file was not created by Microsoft Office.

Look in the correct AppData Folder: The temporary files for the current logged-in user are stored in the AppData folder under the user profile. If you are logged in as a different user, the temporary files will be stored in that user's AppData folder. Make sure you are looking in the correct folder.

Check the File Size: A temporary file should be very small, often less than 1 KB. If the file you found is very large, it is likely not a temporary file. It is probably the original file that has been saved in a different location.

Try a Different Method: If you are unable to find the temporary file using the %temp% method, you can also try using the Windows Search function. Open the Search function and search for the filename of your Excel file. Look for files with the ~$ prefix. This method may be more effective if the file is not located in the %temp% folder.

Use a Professional Data Recovery Service: If you have exhausted all other options, you may need to use a professional data recovery service. These services can recover data from damaged or corrupted hard drives, even if the file has been permanently deleted. However, these services are expensive and are not always successful.

Frequently Asked Questions

Does this method work for files saved on OneDrive?

No, this method relies on temporary files created by the local Office application. If your file is saved on OneDrive and you have lost the local version, you should check the OneDrive website or the "Recycle Bin" in the OneDrive interface to restore the file.

What if the temporary file is not in the %temp% folder?

It is possible that the temporary file is stored in a different location, such as the Office User Data folder. However, the %temp% folder is the most common location for temporary files. If you cannot find the file there, you can try using the Windows Search function to look for the file by name.

Why is the recovered file read-only?

The recovered file may be read-only if it was opened in Outlook in a read-only mode. You can change the read-only status by right-clicking on the file, selecting "Properties", and unchecking the "Read-only" box.

Does this method work for Mac computers?

The method described above is specific to Windows. On Mac computers, the temporary files are stored in a different location and are named differently. You may need to use a different method to recover a file on a Mac, such as using Time Machine or a file recovery tool.

What does the tilde (~) prefix mean in a file name?

The tilde prefix (~$) is used by Microsoft Office to indicate that a file is a temporary file. These files are created when an Office document is opened and are used to store information about the document's state while it is being edited. They are automatically deleted when the document is closed.

Can I recover a file that was deleted from the Recycle Bin?

If the file was deleted from the Recycle Bin, it is no longer in the file system. The temporary file method will not work because the file no longer exists. You would need to use a file recovery tool to scan your hard drive for deleted files.