To resolve Outlook data file corruption and move that data into Excel, you must first use the Inbox Repair Tool (scanpst.exe) to fix the database errors and then use the Export wizard to create a CSV file. Outlook cannot open a corrupted .pst or .ost file directly, and Excel cannot read these proprietary database formats without first converting them to a comma-separated values (CSV) format via Outlook's internal tools.

What You'll Need

  • A Windows PC with Microsoft Outlook installed.
  • Administrative privileges to access the Program Files folder.
  • Microsoft Excel installed for viewing the exported data.
  • A backup copy of your current corrupted data file (highly recommended before attempting repairs).

Step-by-Step

  1. Locate the ScanPST.exe Tool: Close Microsoft Outlook completely. Open File Explorer and navigate to the folder where your Office installation is located. Depending on your version and installation type, this is typically found in C:\Program Files\Microsoft Office\root\Office16 (for Office 365/2019/2016) or C:\Program Files (x86)\Microsoft Office\Office15. Look for a file named scanpst.exe.
  2. Run the Repair Process: Double-click scanpst.exe to launch the Inbox Repair Tool. In the window that appears, click Browse to locate your corrupted .pst file. If you are unsure where the file is, check Documents\Outlook Files or AppData\Local\Microsoft\Outlook. Once the file is selected, click Start.
  3. Analyze and Repair: The tool will scan the file for errors. If errors are found, the tool will prompt you to repair them. Ensure the checkbox "Make a backup of scanned file before repairing" is checked. Click Repair. If the tool indicates that the repair was not fully successful, you may need to run the process multiple times until no further errors are detected.
  4. Open Outlook and Verify: Once the repair is complete, launch Microsoft Outlook. Verify that your folders, emails, and contacts are appearing correctly and that the application no longer crashes or displays "data file cannot be opened" errors.
  5. Initiate the Export Wizard: To move this data into Excel, go to the File menu in the top left corner. Select Open & Export and then click Import/Export. Note that menu labels may differ slightly depending on your specific version of Outlook or region.
  6. Select the Export Format: In the Import and Export Wizard, select Export to a file and click Next. From the list of file types, choose Comma Separated Values (CSV). This is the only format that Excel can natively open as a structured spreadsheet. Click Next.
  7. Choose the Data Folder: Select the specific folder you wish to export. For example, if you want your contacts in Excel, select the Contacts folder. If you want emails, select the Inbox. You cannot export the entire data file (all folders) into a single CSV; you must repeat this process for each folder you need. Click Next.
  8. Save the File: Click Browse to choose a location on your computer to save the CSV file and give it a descriptive name (e.g., "Outlook_Contacts_Backup.csv"). Click Finish.
  9. Import into Microsoft Excel: Open Microsoft Excel. Go to the Data tab on the ribbon. Select From Text/CSV. Browse to the file you just saved and click Import.
  10. Format the Data: A preview window will appear. Ensure the delimiter is set to "Comma." Click Load. Your Outlook data will now appear in an Excel table, where you can filter, sort, and analyze the information.

Common Mistakes

One of the most frequent mistakes is attempting to open a .pst file directly in Excel by changing the file extension. This will not work because .pst files are complex binary databases, not text files; doing this will only result in a screen full of unreadable symbols (mojibake). Another common error is running the ScanPST tool while Outlook is still open. The repair tool requires exclusive access to the data file; if Outlook is running in the background, the tool will report that the file is in use and will fail to start the repair.

Users also often forget to back up the corrupted file before running the repair tool. While ScanPST is generally safe, a repair process can occasionally lead to further data loss if the file is severely damaged. Always copy the .pst file to an external drive or a different folder before clicking "Repair." Finally, many users try to export their entire mailbox at once. Because CSV files are flat structures, they cannot handle the hierarchical folder structure of Outlook. You must export folders individually to maintain data integrity.

Tips

To prevent future corruption, avoid shutting down your computer while Outlook is still open. Forcing the application to close during a write operation is a primary cause of header corruption in .pst files. If you have a very large data file (over 20GB), consider archiving old emails into separate .pst files to reduce the load on the primary database and speed up the ScanPST process.

When importing the CSV into Excel, use the "Text Import Wizard" or the "Power Query" (Get Data) feature rather than simply double-clicking the CSV file. This allows you to manually define the column types, ensuring that phone numbers starting with zero are not truncated and that dates are formatted correctly according to your region.

Troubleshooting

If ScanPST.exe reports that it cannot find the file, ensure you have the correct file path. Hidden folders like AppData may be invisible; you can access them by typing %localappdata% into the Windows search bar and pressing Enter. If the repair tool runs but the file remains corrupted, check if the file is marked as "Read-only" in the file properties. Right-click the .pst file, select Properties, and uncheck the Read-only box before running the tool again.

If the exported CSV file appears as a single column of text in Excel instead of a table, it means Excel did not recognize the comma as a delimiter. To fix this, highlight the first column, go to the Data tab, select Text to Columns, choose Delimited, and then check the Comma box. If you encounter a "File too large" error during export, try exporting smaller date ranges or specific subfolders rather than the entire Inbox.

Frequently Asked Questions

Can I fix a corrupted .ost file using ScanPST?

No, ScanPST is designed for .pst files. .ost files are offline caches of exchange accounts. If an .ost file is corrupted, the best solution is to delete the .ost file and allow Outlook to recreate it by re-downloading the data from the server.

Why are some emails missing after the repair?

The repair tool removes corrupted entries to make the file readable again. If a specific email was too damaged to be recovered, the tool deletes that entry to prevent the entire database from crashing.

Is there a way to export all Outlook folders to one Excel sheet?

Not natively. You must export each folder (Inbox, Sent, Contacts) as a separate CSV and then copy-paste the data into different tabs within a single Excel workbook.

What is the difference between a .pst and .ost file?

A .pst (Personal Storage Table) is used for POP3 accounts or local archives. An .ost (Offline Storage Table) is a synchronized copy of a mailbox hosted on a server, such as Microsoft 365 or Exchange.

Will exporting to Excel delete my emails from Outlook?

No, the export process creates a copy of your data. Your original emails and contacts remain safely inside your Outlook data file.