Link Search Menu Expand Document

SSpread.IsExcel2007File Method

Explanation Find out if the file is an Excel 2007 format workbook and if it is protected
Added since Ver.5.0.2
Call format IsExcel2007File(URL or Reader)
Return value The following values are returned
Value Description
0 Not an Excel 2007 format file
1 Excel 2007 format file
2 Password protected Excel 2007 format file
Arguments URL or Reader The URL of the Excel2007 format file to be read , or the Reader Object

The file will be cached on local computer for faster loading from the next time onwards if URL is specified. The latest files from the server can be acquired by specifying an HttpResponse object.
Exception EXT-24 No valid Reader object specified
Example of use
    var session = findHttpSession("http://example.com");
    var res = session.Get("excel2007file.xlsx");
    if (IsExcel2007File(res) > 0) {
        MessageBox("This is an Excel 2007 format file");
    }
    
Related item OpenExcel2007File, SaveExcel2007File methods
HttpResponse class