I want a list of hyperlinks on a basic html page, which point to files on our corporate intranet.
When a user clicks the link, I want the file to open. They are excel spreadsheets, and this is an intranet environment, so I can count on everyone having Excel installed.
I've tried two things:
<a href="file://server/directory/file.xlsx">Click me!</a>
<HTML>
<HEAD>
<SCRIPT LANGUAGE=VBScript>
Dim objExcel
Sub Btn1_onclick()
call OpenWorkbook("\\server\directory\file.xlsx")
End Sub
Sub OpenWorkbook(strLocation)
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = true
objExcel.Workbooks.Open strLocation
objExcel.UserControl = true
End Sub
</SCRIPT>
<TITLE>Launch Excel</Title>
</HEAD>
<BODY>
<INPUT TYPE=BUTTON NAME=Btn1 VALUE="Open Excel File">
</BODY>
</HTML>
I know this is a very basic question, but I would appreciate any help I can get.
Edit: Any suggestions that work in both IE and Firefox?
To load external HTML into a <div>, wrap your code inside the load() function. To load a page in div in jQuery, use the load() method.
Open the saved HTML file in your favorite browser (double click on the file, or right-click - and choose "Open with").
Try formatting the link like this (looks hellish, but it works in Firefox 3 under Vista for me) :
<a href="file://///SERVER/directory/file.ext">file.ext</a>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With