0

I am trying to open and excel file using javascript.. i keep getting

"Uncaught ReferenceError: ActiveXObject is not defined"

How can I fix this error?

 function LoadValue()
      {
            var app = new ActiveXObject("Excel.Application")
            if(app!=null){
                  return true;
                  app.visible = true;
                  document.getElementById("f1").src = 'myApp.workbooks.open("C:\\Documents and Settings\\Adnan\\Desktop\\MIS\\Reports\\Sales\\2005_Daily_Sales.xls")';
            }
            return false;
      }
Community
  • 1
  • 1
user244394
  • 13,168
  • 24
  • 81
  • 138
  • 2
    Possible duplicate of [ActiveXObject in Firefox or Chrome (not IE!)](http://stackoverflow.com/questions/7022568/activexobject-in-firefox-or-chrome-not-ie) – Adam Azad Jan 03 '17 at 22:16
  • 1. Where is the jQuery code here? 2. `ActiveXObject` is not supported in most modern browsers. – Dekel Jan 03 '17 at 22:16
  • 3. You `return true;` on the first line of your `if` block, so none of the other lines would run, even if there was no error... – Heretic Monkey Jan 03 '17 at 22:20

0 Answers0