The file may be corrupted located on a server that is not responding or read only Excel

I'm using ExcelDataReader to read .xls files and extract data. However, I cannot open .xls files which I got from external device due to Invalid file signature exception (I can open it with Excel, but it gives me a pop up that file format and extension don't match and if I want to open it anyway).

FileStream stream = File.Open(filePath, FileMode.Open, FileAccess.Read);
IExcelDataReader excelReader = ExcelReaderFactory.CreateReader(stream);

I have tried to open it using Interop, however, got ***.xls file cannot be accessed. The file may be corrupted, located on a server that is not responding, or read-only exception.

Missing missing = Missing.Value;
Application excel = new Application();
Workbook workbook = excel.Workbooks.Open(filePath,
         missing, missing, missing, missing, missing,
         missing, missing, missing, missing, missing,
         missing, missing, missing, XlCorruptLoad.xlRepairFile);

Is there any way to repair/restore/open/read those corrupted files?

p.s. Open manually with Excel and do SaveAs is not an option as I would need to do it for hundred of files.

The file may be corrupted located on a server that is not responding or read only Excel

Symptom:

When opening a damaged or corrupt Excel XLS or XLSX file with Microsoft Excel, you see the following error message:

‘filename.xls’ cannot be accessed. The file may be read-only, or you may be trying to access a read-only location. Or, the server the document is stored on may not be responding.

where ‘filename.xls’ is the corrupt Excel file name.

Below is a sample screenshot of the error message:

The file may be corrupted located on a server that is not responding or read only Excel

Precise Explanation:

When an Excel XLS or XLSX file is corrupt and Microsoft Excel cannot recognize it, the Excel may report this error. The error information is misleading since it says the file cannot be accessed because it is read-only. However, even the actual file is NOT read-only, if it is corrupt, Excel will still report this error by mistake.

Solution:

You can first check if the file is read-only, on a read only location, or on a remote server. If the file is on a read only location or on a remote server, then try to copy the file from the read-only location or server to a writable drive on the local computer. The make sure you remove the read-only attribute of the Excel file.

If the Excel file still cannot be opened, then we can confirm the file is corrupt. You can first use Excel built-in repair function to repair the corrupt Excel file. If that does not work, then only DataNumen Excel Repair can help you.

Sample File:

Sample corrupt XLS file that will cause the error. Error5.xls

The file recovered by DataNumen Excel Repair: Error5_fixed.xls

References:

  • https://support.microsoft.com/en-gb/office/repair-a-corrupted-workbook-153a45f4-6cab-44b1-93ca-801ddcd4ea53

The file may be corrupted, located on a server that is not responding, or read-only. Excel data recovery.

You receive error messages when you try to open an Office document:
“The file may be corrupted, located on a server that is not responding, or read-only”

www.duomenu-atkurimas.lt data recovery center can help You recover Excel, Word data in a few hours (1-3 h).

 Excel error message before recovery

The file may be corrupted located on a server that is not responding or read only Excel

After recovery in our center

The file may be corrupted located on a server that is not responding or read only Excel

Our data recovery center can help You recover corrupted MS Excel, Word data.

Excel file recovery price only 49$. You pay only for result after full recovery!

JSC ALFATEL

p/d 2829, Gedimino ave. 7, LT-01103 Vilnius, Lithuania

Our e-mail:

Phone: +370 604 65631

Web.: www.duomenu-atkurimas.lt

How do you fix the file is corrupted and Cannot be opened Excel?

Repair a corrupted workbook.
Click File > Open..
Click the location and folder that contains the corrupted workbook..
In the Open dialog box, select the corrupted workbook..
Click the arrow next to the Open button, and then click Open and Repair..
To recover as much of the workbook data as possible, pick Repair..

Why does Excel keep telling me files are corrupt?

The main causes for "the file is corrupted and cannot be opened" in Microsoft Excel or Office are: The changes of settings in Microsoft Office after upgrading or reinstallation. Protection of your computer against the files come from another computer. The Excel or Word file is corrupted.

How do you know if an Excel file is corrupted?

The following are common signs that your Excel file is corrupt. When you try to open your file and it fails to respond, there is a chance it is corrupt. Sometimes you may get the error message 'Unable to read file'. Another error you are likely to come across is 'Excel Cannot Open the File '(Filename)'.

Can not be accessed the file may be corrupted?

Behind this cannot be accessed the file may be corrupted error then the reason is the usage of MS Office 32-bit version over 64-bit version window's PC. Thus it is recommended to reinstall the MS Office application and make sure to install the 64-bit version of Office over the 64-bit version PC.