if excel not instaled then i guess you want to store/download that file. If so then
if (!IsMsExcelInstalled()){
var fileInfo = new FileInfo(fileFullName);
string fileName = Path.GetFileName(fileFullName);
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment; filename=" + fileName);
HttpContext.Current.Response.AddHeader("Content-Length", fileInfo.Length.ToString());
HttpContext.Current.Response.ContentType = "application/octet-stream";
HttpContext.Current.Response.Flush();
HttpContext.Current.Response.WriteFile(fileFullName);
HttpContext.Current.Response.End();
}
You you want to download other file types then you need to change the value of
HttpContext.Current.Response.ContentType
property. for example if you download pdf file then the value will be
HttpContect.Current.Response.ContentType="Application/Pdf"
If it is doc file then
value will be "Application/msword".