?
Solved

How can I control MS Excel within a browser?

Posted on 2006-03-23
7
Medium Priority
?
2,869 Views
Last Modified: 2008-01-09
I need to allow a user to open Excel files within a browser, edit them and then save them remotely back to the server.
I am using the following code to open Excel but it is popping up in a separate window outside the browser. How can I force Excel to open inside the browser ?

var myActiveX = new ActiveXObject("Excel.Application");
myActiveX.Application.Visible=true;
myActiveX.Workbooks.Open("http://somehost:8080/webDavDrive/Book1.xls");
0
Comment
Question by:philfcorcoran
  • 2
  • 2
5 Comments
 

Expert Comment

by:mvmacke
ID: 16268432
Maybe not exactly an answer to your question. But have you thought of using
http://numsum.com/
This takes away a lot of development and maintenance on your side.

Marcel
0
 

Author Comment

by:philfcorcoran
ID: 16268860
Nice site and very good interface but it's not what I need. I am part of a team writing an application for users to edit MS Office documents remotely and save them transparently back to the server.
0
 
LVL 29

Expert Comment

by:rdivilbiss
ID: 16342977
Opening the spreadsheet outside the browser...that behavior is dependent on the local settings of the PC with the browser and those are not available to your web server or its scripts to manipulate.  The only browser which might open the spreadsheet without opening a new window is IE and that may or may not work after the April-06 security update for IE which is also going to cripple ActiveX. (MS lost a lawsuit to Eolas on patent infringement re: ActiveX [http://www.emailbattles.com/archive/battles/ip_aadahdadhj_jf/])

As to the saving of the results: When the client browser loads an excel spreadsheet it is saved to that local machines temporary internet files (cache) and opened from there. After editing, any attempt to save changes will open a dialog to save the file on the local machine...not the server.  This of course is due to the security model of the browser and web server.  For the client to be able to save the changed file back to the server, the client must have write permissions on the server to the directory where the spreadsheet exists.

Normally, giving write access to the client browser is not a good idea.  e.g. the client can then write any file in the directory and hack away at their pleasure.  If you will do this, you should isolate the files to a separate directory or even a virtual directory outside of the web root.  Authentication is preferred so you are not giving IUSR_machine write permissions.

Http is a disconnected protocol so there is no way to maintain file lock information and multiple people could change the same file or crash into each other with an attempt to write the file simultaneously.  WebDAV may assist the with file locking issue and I notice some indication that you may be using WebDAV.

Some possibly related questions with answers:

http://www.experts-exchange.com/Web/Web_Languages/ASP/Q_20728614.html
http://www.experts-exchange.com/Web/Q_20836430.html

0
 

Author Comment

by:philfcorcoran
ID: 16369456
Thanks for your response. Looks like we will have to live with Excel opening outside of the brwoser since we do not want to get involved in desktop maintenance. We developed a prototype using webdav. A user can map a drive in windows to a webdav url. Then we have a servlet respond to the webdav messages such as lock or move. The user can then open files on the web server using windows explorer, edit them and save his changes.However the client could then be any windows application such as windows explorer, excel, word etc. We want to limit the number of clients we support so we wanted to integrate better with the browser.We tried using java applets also. The  browser security model is definitely a limiting factor. The vbscript shown previously means that a user has to accept ActiveX and our operations team saw this as a security risk.
0
 
LVL 29

Accepted Solution

by:
rdivilbiss earned 2000 total points
ID: 16371070
>The  browser security model ...

Yes. Many, many people run into this frustration. Thin Client, Fat Client and Browser Client all have their place, but trying to make a browser act like a thin clinet is not going to be possible because of security. Circimventing the browser's security will lead to more problems than you solve.

Java Applets, ActiveX and other technologies offer a change for more client side interaction but also come with a cost. I don;t think many of us have a grasp on what the full impact of the Eolas patent settlement will bring but I think a lot of Intranet applications are going to break in a few weeks.  Funny enough, it was mentioned that some NS/Gecko plugins also violate the Eolas patent but Eolas said they were not going to sue the open source browser companies.

For really good interaction, I tend to want to look at a server side presentation layer for the excel spreadsheets rather than opening them on the client. That involves a tremendous amount of programming and has its down side as well, but there are products available to do that.

I gave up on WebDAV many years ago for some of the reasons you are struggling with. That does not mean it does not have value or potential, but it seemed to be more trouble than it was worth.

Sorry the suggestions were not more substantive.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Dramatic changes are revolutionizing how we build and use technology. Every company is automating, digitizing, and modernizing operations. We need a better, more connected way to work together as teams so we can harness the insights from our system…
Over time, the online landscape has altered considerably, but that’s nothing compared to the up-and-coming trends that will shape the web design industry in the coming year. Keep reading to find out which trends will shape B2B web design in 2018.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.
Suggested Courses
Course of the Month15 days, 3 hours left to enroll

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question