IsFileExcel

IsFileExcel checks if the given file is an Excel file (.xls, .xlsx, …).

nVersion = IsFileExcel(ssFileName)

Return Value

This function returns the version number multiplied by 10, or 0 if the file is not an Excel file or cannot be opened.

Parameters

ssFileName

ssFileName is the file name.

Example

if (IsFileExcel("c:/data/test.xls")) {
    MessageBox("test.xls is an Excel File");
} else {
    MessageBox("test.xls is not an Excel File");
}

id-328338