Solved

Run Excel from Client machine

Posted on 2011-03-18
7
313 Views
Last Modified: 2012-05-11
I am using the code below on my ASP intranet application to run a local Excel file. A few questions:

1) Is there really no way to get rid or bypass the windows security msg asking to run or save the file? Any workaround idea? Can I customize this msg? If so, please provide code...

2) Can I change the siz of the window which is opened by my code?

3) can anyone suggest any other better solution for this purpose (to run an Excel file - which then has its macros, etc - on client machine)

My code
-----------------------------------------------------------
<script type="text/javascript">
var saprisco = 'file://C:/Projetos Primavera/desbloquear.xls'.replace(/ /g,'%20');

function Run(commandtoRun, commandParms) {
  var oShell = new ActiveXObject("Shell.Application");
  oShell.ShellExecute(commandtoRun, commandParms, "", "open", "1");
  return false;
}
</script>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>SAPRISCO - Acesso a um aplicativo externo</title>
</head>
<p align="center">
<img border="0" src="c:/inetpub/wwwroot/coppe/images/logosap-risco.jpg" width="348" height="125"></p>
<p align="center">&nbsp;</p>
<p align="center">Esta é uma conexão segura SAPRISCO</p>
<p align="center"><a href="#" onclick="return Run('excel.exe',saprisco)">Clique aqui para continuar</a>
</p>
--------------------------------------------------------------


Thanks
0
Comment
Question by:Roberth509
  • 3
  • 2
7 Comments
 

Author Comment

by:Roberth509
ID: 35166429
Sorry, one more question:

What code needs to be incremented to my code so that my original  windows closes after the user clicks CLICK AQUI PARA CONTINUAR and the windows  message appears,.

thanks again
0
 

Author Comment

by:Roberth509
ID: 35177025
Can anyone please help?
0
 
LVL 33

Accepted Solution

by:
Big Monty earned 500 total points
ID: 35232858
i dont think you can bypass the message box, its a security feature provided by the browser.

to change the width and height, you'd need to set that in the commandParams variable, I don't have the exact syntax on me, but I'm sure you can easily google it.

i dont think you're going to have a nice clean way to run a file on someones local computer, obviously for security purposes. While your intent is benign, I would always want to be made aware of files were being run on my local computer by a web site I visited.
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:Roberth509
ID: 35233333
Hi,
I could not find the width and height paramaters...is the hta approach the best?
Thanks,
Robert
0
 
LVL 33

Assisted Solution

by:Big Monty
Big Monty earned 500 total points
ID: 35234420
here are the different window styles you can use:

http://msdn.microsoft.com/en-us/library/d5fk67ky(v=vs.85).aspx

I do think this approach is the best, I'm assuming this is going to be on some kind of (secure) intranet? If so, a little bit of training for the users will help them understand why they're getting the security message.
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 35872814
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question