0

Basically need to identify the excel is originally created from a valid excel. I have tried using Microsoft.Interop.Excel File format. Seems like I cannot use this without Microsoft office being installed. So need another approach for this problem.

EDIT : Basically I want to be able to distinguish a valid excel from invalid one like an excel file which is converted from DLL. Because the file extension will say it is xls. If you try to open that file, it will open an empty workbook without any sheets. But I cannot decide an excel with no sheets is an invalid one.

1 Answers1

0

If you want to idenify wheter file is a valid excel file or not, you can use 'trid file identifier'. TrID - File Identifier.

You can do it own your own also by reading magic number or file signaure bytes. Please go through this question Original file bytes from StreamReader, magic number detection.

Himanshu Mange
  • 104
  • 1
  • 10