1

I want to open a excel document while loading a web page but i don't know how. I tried this:

<script>
function myFunction() {
    window.open("file:///D://Files/doc.xlsx");
}
</script>
<body onload="myFunction()">
</body>

But it didn't work. I want to mention that it has to be done for IE8 and less.

2
  • Are you using native HTML? Commented Dec 28, 2017 at 14:42
  • So all the users have the file at that location? Or is this just for you? Commented Dec 28, 2017 at 14:47

1 Answer 1

0

Add tag <script> to <head>

<head>
  <script>
   function myFunction() {
      window.open("file:///D://Files/doc.xlsx");
   }
  </script>
</head>
<body onload="myFunction()">
</body>
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.