Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I launch Excel files from an ASP page with IE?

Status
Not open for further replies.

Ayac

Programmer
Nov 10, 2000
141
HU
Hi all!

I want to launch documents in their own applications. The code below works with Word files and Internet Explorer (I have IE 5.5 and Office 2000) setting the security level to Low. If I want to use the same script to download an Excel application (and replace "Word.Application" with "Excel.Application", the browser launch Excel but then it stops and refuse to load the xls file:


<script language=&quot;VBScript&quot;>
<!--
Sub MenuClick()
Dim ojbWord
Set objWord = CreateObject(&quot;Word.Application&quot;)
objWord.Visible = true
objWord.Documents.Open &quot;/mywebsite/test.doc&quot;
Set objWord = Nothing
window.location.href=&quot;/home.asp&quot;
End Sub
//-->
</script>
...
<body onLoad=&quot;VBScript:MenuClick()&quot;>

Does anyone have any ideas how can I fix this? Is there possibly any ASP turn-around?

I would really appreciate your help,

Thanks!

Ayac
 
You can just use a basic A HREF if this is good enough? You get asked whether you want to open it or save it. Click OPEN and IE will open it for you.

<A HREF=&quot;./test.xls&quot;>Open Excel Doc</A>

Is this good enough for your needs?? Brett Birkett B.Comp
Systems Analyst
 
No, my purpose is to get rid off those popup windows what ask you all that crap about &quot;open document in current location &quot; etc. and so on, because it will confuse the average user.
I know I can turn those annoying notify windows in IE, but this is a generic setting for the browsers, our IT manager has some concerns about security if we let browsers launch applications without any warning message. So if we can set up our browsers and tell that our intranet site is a trusted site and set the security low, with this script we can open documents without weakening the browsers security to the outer world and be able to open our internal documents directly without any popup nightmares...

Ayac
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top