I am trying to open an Excel worksheet from the internet directly without viewing it through a browser.
I found this code in Visual Basic:
1. Add the following to the webpage in the <HEAD></HEAD> section:
<SCRIPT LANGUAGE=VBScript>
Dim objExcel
Sub Btn1_onclick()
call OpenWorkbook("http://www.microsoft.com/subdirectory/test.xls")
End Sub
Sub OpenWorkbook(strLocation)
Set objExcel = CreateObject("Excel.Application")
objExcel.Visible = true
objExcel.Workbooks.Open strLocation
objExcel.UserControl = true
End Sub
</SCRIPT>
================================================== ==========
2. Then add the following to the webpage in the <BODY></BODY> section:
<INPUT TYPE=BUTTON NAME=Btn1 VALUE="Open Excel File">
================================================== ==========
3. Insert the correct path to the Excel file.
================================================== ==========
NOTE: You don't have to use a url in the above example:
Ex: OpenWorkbook("\\server\share\folder\file.xls")
Ex: OpenWorkbook("g:\folder\file.xls")
NOTE2: You can change "Open Excel File" to anything you want:
Ex: VALUE="Click Here to open my spreadsheet"
This works great locally from my computer. Even if I open the local html page and have it set to go fetch the Excel file on the internet, it open fine. But when I install the index.html on the web, nothing happens.
Does this only work from a windows server? I am currently on a Linux server.
I am also wondering if there should not be a <a href> link to the xls file, however the button owrks locally, but not on the web.
Credit for this code goes here:
Miscellaneous: Open a Spreadsheet into Excel from IE - www.enterpriseitplanet.com
He even has an example you can download and try on your computer.
Any ideas anyone?