0
   

Getting Javascript web page to work in IE8

 
 
Reply Thu 27 Oct, 2011 09:59 pm
Good evening.

I'm trying to code a website that will read data from an Excel file (stored either locally or elsewhere) and input a row of data (searched based on a Drop-Down List) into a table on the web page itself. Every time I open the page (it's currently stored on my local drive, on a laptop running Windows 7) in IE8, though, I get the error "Automation Server Can't Create Object" and nothing happens. The Excel file doesn't get opened and the table is blank. Thing is, though, I tried opening the same web page on another computer with IE6 and Windows 2000, and the Script works perfectly there.

I've been searching for a solution to this for a week, and some people suggested elsewhere that it's a problem with IE8's security settings. I lowered them as far as they'll go and enabled Running the Script Not Marked As Safe for all possible zones, same result, the Script refuses to run with the "Automation Server Can't Create Object" error. Here's the applicable lines of code:

function loadData() {
// try {
var Excel, Book;
var a = document.getElementById("projectDrop");
Excel2 = new ActiveXObject("Excel.Application"); <--- This is where the error seems to register
Book2 = Excel2.Workbooks.Open("TestSheet.xls");
idTmr = window.setInterval("Cleanup();",1000);
var sheet2 = Book2.Worksheets("Sheet1");
var b = document.getElementById('tableDisplay').getElementsByTagName('tr');
Excel2.Visible = false;
var i=1;
while(sheet2.Cells(i,1).Value != null)
{
if (sheet2.Cells(i,1).Value == a.options[a.selectedIndex].text)
{
b[0].cells[0].innerHTML = sheet2.Cells(i,1).Value;
b[0].cells[1].innerHTML = sheet2.Cells(i,2).Value;
b[0].cells[2].innerHTML = sheet2.Cells(i,3).Value;
b[0].cells[3].innerHTML = sheet2.Cells(i,4).Value;
}
i++;
}
Excel2.Quit();
// }
// catch(e) {

// }
}

I'm completely stumped, everyone. Is it some obscure setting I'm forgetting to check in IE8, is my Java not fully updated, or what is it? Again, it works perfectly on my old Windows 2000 w/ IE6 computer, but not on a recent Windows 7 laptop with IE8. I'd appreciate any help.

Thank you.
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Question • Score: 0 • Views: 1,903 • Replies: 0
No top replies

 
 

Related Topics

How does one uninstall a program? - Question by Woollcott
Adding a JavaScript 'Copy to Clipboard' - Discussion by BobbyDouglas
JavaScript: OnSelect question - Discussion by neocode
Javascript - Control C textarea script - Discussion by Craven de Kere
2018123 - Question by ibk1995
javascript loops for - Question by vartul agnihotri
 
  1. Forums
  2. » Getting Javascript web page to work in IE8
Copyright © 2022 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.03 seconds on 06/24/2022 at 07:03:58