469,277 Members | 2,055 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,277 developers. It's quick & easy.

Need JavaScript Code to Set default Yes Option to MSG BOX

144 100+
Hi friends,

I have a below JavaScript code which will open an excel sheet.

Expand|Select|Wrap|Line Numbers
  1. <script language="JavaScript">
  2. var myApp = new ActiveXObject("Excel.Application");
  3.  
  4.             if (myApp != null)
  5.             {
  6.                   myApp.visible = true;
  7.                   myApp.workbooks.open("C:\Spreadsheet.xls");
  8.             }
  9. <script>
  10.  
While Opening this particular Excel sheet there will be always MSG BOX like below


"some of the files in this web page aren't in the expected location. Do you want to download them anyway if you're sure the web page is from a trusted source click 'yes'"


Once I manually click "Yes" then only this Excel Sheets shows its data.

Is there any JavaScript Code which can defaultly set "Yes" to this MSG BOX. SO that there is no need to manually click "Yes" Every Time.Once I run this Code the Excel sheet opens and shows its data.

Thanks in Advance.
.
Feb 10 '12 #1
1 1387
gits
5,390 Expert Mod 4TB
since this is a security-warning you can only control this by setting the policy-settings in IE, so you only can do that on a local machine. if it's a intranet this could be set for all internal machines but you cannot do it with JavaScript - since if you could - you would have the possibility to execute nearly everything without at least a notification/confirmation of the user from a website. this would be a massive security-issue so it even mustn't be possible with JavaScript.

kind regards
Feb 22 '12 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by | last post: by
28 posts views Thread by Noone Here | last post: by
22 posts views Thread by the_grove_man | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.