I have the following code in the head section of my web page:
var serverLoc = "http://www.mydomain.com/mypath/";
var serverFile = serverLoc+"myexcel.xls";
var ehandle = new ActiveXObject("Excel.Application"); //error occurs
var eWBhandle = ehandle.Workbooks.Open(serverFile);
var eShandle = eWBhandle.ActiveSheet;
var cell1 = eShandle.Cells(1,1).Value;
// get more data
It works fine when I'm launching the page on my local machine referencing an xls on my hard drive (serverLoc). But when I upload the page to a server along with the xls file (changing the path of the file, of course), I get the above error. Note, I am simply reading the contents of the xls and pulling certain data out to be displayed on my page.
My ActiveXObject internet settings are set to prompt me. Even if I open the flood gates and change the setting to Enable, I still get the above error. As a result, anything I do beyond the open of the spreadsheet does nothing.
I really need help in resolving this or coming up with an alternate approach. Ultimately, I need to provide my users with a low tech solution of adding/changing some data (storing it in an external file of some sort) that I can then read to display on a page. We're talking about maybe a dozen records with about 10 cells of information. So a "database" isn't really called for and, as I said, I need a low tech solution because this user group is not tech savvy. In fact, I would have to teach them how to use Excel.
And I can't expect visitors to the site to open up their security so they don't encounter an error as well as the inability to see the data my users are maintaining externally via a file. If it was a matter of changing an internet setting to prompt the user to allow running my ActiveXObject, I could inform them of that requirement but wouldn't want to force them to completely expose themselves with an enable setting. But a prompt or enable doesn't fix the problem anyway.
I had read somewhere that getting a signed certificate and attaching it to my code (and this is above my head) would solve this problem. But if this is truly the solution, then I need help in understanding how this works precisely. How do I attach it to my code exactly? So just thinking out loud here. Bottom line.....
any and all help is appreciated!!!