?
Solved

Run Excel from Client machine

Posted on 2011-03-18
7
Medium Priority
?
331 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 2000 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
WordPress Tutorial 3: Plugins, Themes, and Widgets

The three most common changes you will make to your website involve the look (themes), the functionality (plugins), and modular elements (widgets).

In this article we will briefly define each again, and give you directions on how to install them.

 

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

WordPress Tutorial 1: Installation & Setup

WordPress is a very popular option for running your web site and can be used to get your content online quickly for the world to see. This guide will walk you through installing the WordPress server software and the initial setup process.

Question has a verified solution.

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

This article discusses how to create an extensible mechanism for linked drop downs.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

777 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