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.
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..