Solved

Run Excel from Client machine

Posted on 2011-03-18
7
320 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
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 

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

Technology Partners: 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!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
embadded search engine in website 4 46
aria difference 2 22
asp.net, radiobuttonlist, c# 3 69
Excel to HTML macro with inserting lines 14 51
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

732 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