AxSpreadsheet cannot open xls
I hope this isnt too late. The AxSpreadsheet web component in .net cannot open xls files. Luckily it can open xml files. When refering to the xml file that you would like to be opened attach either 'file:' or 'http:' as the prefix to the location on disk. Excel can save to xml, as an option in the saveas function or you can convert the xml file programmatically. Here is some example code [in C#.NET]:
private void OpenExcelDoc(string xlsFileName)
{
string xmlFileName = "C:\\temp.xml";
Excel.ApplicationClass excel = new Excel.ApplicationClass();
Excel.Workbook workbook = null;
if (excel != null)
{
workbook = excel.Workbooks.Open(xlsFileName,0,true,5,"","",true,
Excel.XlPlatform.xlWindows,"\t",false,false,0,true,false,false);
}
try
{
excel.DisplayAlerts = false;
excel.ActiveWorkbook.SaveAs(xmlFileName,Excel.XlFileFormat.xlXMLSpreadsheet,
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Excel.XlSaveAsAccessMode.xlNoChange,
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
}
catch (System.Exception e)
{
MessageBox.Show(e.Message);
}
this.axSpreadsheet.XMLURL = "file:" + xmlFileName;
//closing the instances of the excel COM object
excel.Quit();
Marshal.ReleaseComObject(workbook);
Marshal.ReleaseComObject(excel);
}