Solved

Run Excel from Client machine

Posted on 2011-03-18
7
325 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

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

This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

724 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