DHTML/How to display Excel file inside Internet Explorer 6 ?
Expert: Andrew Hoffman - 3/16/2007
QuestionHi,
How to display Excel file inside Internet Explorer 6 ?
Thanks,
lzzzz
AnswerUnfortunately, I don't have a great answer for you. I found this bit of code which "should" work if the server you're on houses the Excel software. When I tried this code from my server using IE6, I got a message from IE telling me:
"Automation server can't create object"
That most likely means that my host doesn't have Excel on their server. However, if your host does have Excel, it might work. Try this script out--and don't forget to replace the name of your excel file in the function call (e.g., <a href="#" onclick="return startXL('Master Contact List.xls')">)
--
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>IE6 Excel Example</title>
<script type="text/javascript">
function startXL(strFile) {
var myApp = new ActiveXObject("Excel.Application");
if (myApp != null) {
myApp.visible = true;
myApp.workbooks.open(strFile);
}
return false
}
</script>
</head>
<body>
<a href="#" onclick="return startXL('Master Contact List.xls')">Pipeline Quality Report</a>
</body>
</html>