1

I am currently attempting to open an embedded excel file found on my company's sharepoint:

<!DOCTYPE html>     
<head>
<title>
Project
</title>
<script type="text/javascript"> 

var excel = new ActiveXObject("Excel.Application");
var excel_file = excel.Open("sharepoint_url/myfile.xlsx");


</script>
</head>
<body>
</body>
</html>

However, whenever I run this, I keep receiving the following error:

Subscript out of range

I was hoping someone could shed some light as to how I should approach this issue. Any help is appreciated.

1 Answer 1

1

Try this.

<html>
<body>

<form name="form1">
  <input type=button onClick="openmyfile()" value="Open File">
  <br><br>
</form>

<script type="text/javascript">
  function openmyfile() {
    var Excel = new ActiveXObject("Excel.Application");
    Excel.Visible = true;
    Excel.Workbooks.Open("sharepoint_url/myfile.xlsx");
  }
</script>

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.