JavaScript Function not working but filters for <script> are removed

I am trying to use the function below to open an excel document on a specific sheet. When I used it on a standalone HTML document the function worked.

The filters filtering settings are already changed to allow tags.

I am running the site on IE 11 as I understand you must to use an activeXobject.
The text doesn't even underline in plone like it does on my standalone test page I created.

Why exactly does the function not work in plone?

<script type="text/javascript">
    function Open_Excel_File(path,sheet)
      {

        fso = new ActiveXObject("Scripting.FileSystemObject");

        if (!fso.FileExists(path))
          alert("Cannot open file.\nFile '" + path + "' doesn't exist.");

        else
         {
           var myApp = new ActiveXObject("Excel.Application");

           if (myApp != null)
             {
               myApp.visible = true;
               Book = myApp.workbooks.open(path);
               var excel_sheet = Book.Worksheets(sheet).Activate;
               myApp.range(f_range).Select;
             }

           else {
             alert ("Cannot open Excel application");
           }
         }
      }
 </script>

<input type="button" value="Load" onclick="Open_Excel_File('C:\\Users\\user\\Desktop\\test1.xlsm', 'sheet2');"> </input>

<a href="#" onclick="Open_Excel_File('C:\\Users\\user\\Desktop\\test1.xlsm', 'sheet2');"> Open with Href</a>

Not sure what you are doing but Plone/TinyMCE will likely filter out script content unless you change the HTML filtering settings Plone...anyway...what is the purpose here? Why don't you just download the file from Plone and open it through a click from the downloads folder? But apparently you are trying to open a local files...makes no sense to why you would to that from within Plone.

The filter is already turned off for script. I am aware of the option to download it but many computers on a local network will be accessing this file and it must be the same version. Also the file is not going to be local it is going to grab it from the file server we have.

use xmldirector.connector to mount the shared FS into Plone and create a link to the file within the mounted folder but forget this ActiveX :put_litter_in_its_place:

The main use for script or even ActiveX was to open the spreadsheet to a specific sheet. Do you know of any packages that allow for that to happen?

I appreciate pointing me in the direction of xmldirector.connector though I've never looked into it.

That's beyond the scope of Plone.

The alternative is always to create your own brownser view with your own template where you can use your own JS as needed.

No idea about the script filtering. In general it is a very bad idea to allow authors to inject arbitrary HTML and JS through TinyMCE. If the site is in your own hand, write a small browser view..

Slightly off topic, but have you considered using something else which can be stored online and link to that ?

For google docs you have different URLs for sheet 1 and sheet 2 of a Spreadsheet.

I have looked into that. The spreadsheet contains very sensitive information and I don't think my boss would go for storing it online.

Plone Foundation Code of Conduct