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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can I create a link to an excel sheet that opens Excel?

Status
Not open for further replies.

KSLtechie

Technical User
May 30, 2003
12
GB
I run our local Intranet site and have a link to an excel sheet. At present it opens in IE, but wondered if i could get it to open in Excel, in a new Window, thus having the full functionality of excel.

Thanks.
 
[tt]If you have a link pointing to a page that executes the opening of the excel file it will most likely open in the browser but if you place the path of the excel file in your link it should open in excel.

[tt]

buffalo.gif height="60px" width="30px"

 
Create a file with the following code in (courtesy of Basic-Ultradev)
Code:
<%@LANGUAGE=&quot;VBSCRIPT&quot; CODEPAGE=&quot;1252&quot;%>
<%
Response.Buffer=true
On Error Resume Next
'Create a stream object
Dim tfm_downloadStream
Set tfm_downloadStream = Server.CreateObject(&quot;ADODB.Stream&quot;)
tfm_downloadStream.Type = 1
tfm_downloadStream.Open
tfm_downloadStream.LoadFromFile Server.Mappath(&quot;files/Travel_2004.xls&quot;)
If Err.number = 0 Then
  Response.Clear
  Response.ContentType = &quot;application/octet-stream&quot;
  Response.AddHeader &quot;Content-Disposition&quot;, &quot;attachment; filename=Travel_2004.xls&quot;
  Response.AddHeader &quot;Content-Transfer-Encoding&quot;,&quot;binary&quot;
  Response.BinaryWrite tfm_downloadStream.Read
  tfm_downloadStream.Close
  Set tfm_downloadStream = Nothing
  Response.End()
Else
  tfm_downloadStream.Close
  Set tfm_downloadStream = Nothing  
  Response.Redirect(&quot;oops.asp&quot;)
End If 
'Basic-UltraDev BUD_ForceDownload server behavior
%>
<!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot; &quot;[URL unfurl="true"]http://www.w3.org/TR/html4/loose.dtd&quot;>[/URL]
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
</head>

<body>

</body>
</html>
make sure to change the path and file names. This actually forces the down load bt works with open or save options.

Cheech

[Peace][Pipe]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top