Nexology Community
 
     
 
   

Go Back   Nexology Community > Community Zone > Webmaster Workshop

Reply
 
LinkBack Thread Tools Display Modes
Old 04-22-2010, 07:26 PM   #1
Registered User
 
Dede's Avatar
 
Join Date: Nov 2007
Location: Canada
Posts: 30
Opening Excel from a web page.

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?
Dede is offline   Reply With Quote
Old 04-25-2010, 04:01 AM   #2
HN Top Canine
 
NexDog's Avatar
 
Join Date: Jan 2002
Location: The Nexus
Posts: 13,347
Yah, that won't work on a Linux Server.
__________________
Laurence - [HostNexus Administrator]

- Need Support? Quickest reponses are found at the Support Helpdesk!
- Stay in touch! Make sure you are subscribed to our Lists.
NexDog is offline   Reply With Quote
Old 04-25-2010, 08:59 AM   #3
Registered User
 
Dede's Avatar
 
Join Date: Nov 2007
Location: Canada
Posts: 30
Thanks Laurence.
Out of curiosity though, if I open a windows server account, then it shoud work?
I just took a look at the windows alpha deal you have, and I did not see excel.
This side of things is a bit new to me.

Last edited by Dede; 04-25-2010 at 09:07 AM.
Dede is offline   Reply With Quote
Old 04-25-2010, 07:40 PM   #4
HN Top Canine
 
NexDog's Avatar
 
Join Date: Jan 2002
Location: The Nexus
Posts: 13,347
Let me ask the Windows techs and I'll get back to you.
__________________
Laurence - [HostNexus Administrator]

- Need Support? Quickest reponses are found at the Support Helpdesk!
- Stay in touch! Make sure you are subscribed to our Lists.
NexDog is offline   Reply With Quote
Old 04-26-2010, 06:53 PM   #5
HN Top Canine
 
NexDog's Avatar
 
Join Date: Jan 2002
Location: The Nexus
Posts: 13,347
The page needs to be ASP so vbscript will work. We can add a mime type so the browser can download the excel file but we don't actually provide MS Office tools (unless a client gives us a licence).
__________________
Laurence - [HostNexus Administrator]

- Need Support? Quickest reponses are found at the Support Helpdesk!
- Stay in touch! Make sure you are subscribed to our Lists.
NexDog is offline   Reply With Quote
Old 04-26-2010, 07:02 PM   #6
Registered User
 
Dede's Avatar
 
Join Date: Nov 2007
Location: Canada
Posts: 30
Thanks Laurence.
I am thinking that once the XL file is on the site, it will be up to the individual opening the page to have an excel viewer or the full program to edit it.
I will look into it a bit more, and if my friend wants to give this a try I will be in touch for a windows account.
Dede is offline   Reply With Quote
Old 06-02-2010, 06:44 AM   #7
You and what a
 
RobbieLePommie's Avatar
 
Join Date: Aug 2002
Location: Sydney
Posts: 5,936
(Again, sorry for being late).

This above method requires that Office is installed on the server, and Microsoft clearly say "don't do that" (researched this about 4 years ago - read Considerations for server-side Automation of Office).

If you want the user to read the document, you're best to provide in the lowest format possible (e.g. CSV if you're just showing numbers) and point the user to an appropriate viewer (Open Office is free but awful, there are Excel viewers also available). If you want to display the data on a webpage instead, we found Aspose (paid software) to be extrememly efficient and fully functional, but I've also used PHP scripts for this that work well on simple files.
__________________
Rob
----------------------------
For your information, there's a lot more to ogres than people think.
RobbieLePommie is offline   Reply With Quote
Old 06-02-2010, 08:36 AM   #8
Registered User
 
Dede's Avatar
 
Join Date: Nov 2007
Location: Canada
Posts: 30
Thanks Robbie.
The user actualy wanted to be able to not only read the content, but also modify it on the go. Additionally to the article you quote, I am also unsure about the licencing part.
He wanted to use this for keeping track of a golf game that he and his friends could update in real time. I have found an already developped program that he could purchase. So I have given temporarely given up on this project. This would all have been done through portable phones that already include excel viewers as well etc. A rather interesting project for which I also don't have time right now.
The microsoft warning is pretty emphatic though, so when I have time, I will have to look in a different direction.

Last edited by Dede; 06-02-2010 at 09:15 AM.
Dede is offline   Reply With Quote
Old 02-23-2011, 06:22 PM   #9
Moderator
 
MikeMann's Avatar
 
Join Date: Jun 2002
Location: Los Angeles CA
Posts: 7,532
What about something with say Google Docs?
__________________
Michael Mann

Michael Mann Desktop Publishing
Me On the Net: Facebook | Twitter

Read My Writing

Need a notary in Los Angeles?
I'm a mobile notary
MikeMann is offline   Reply With Quote
Old 02-24-2011, 02:20 PM   #10
Registered User
 
Dede's Avatar
 
Join Date: Nov 2007
Location: Canada
Posts: 30
Thanks for the suggestion MikeMann.
I am so busy with other projects, that I kind of gave up on this one.
There are a number of inexpensive programs out there that did the trick.
Dede is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 12:15 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.0 RC1
Copyright ©2001 - 2009, HostNexus