Solved

Run Excel from Client machine

Posted on 2011-03-18
7
297 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 32

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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

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 32

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 142

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
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…

707 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now