Discussion Locked

URGENT! transfering internet files

0 helpful
7 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

i have been killing myself over this for 2 weeks now. i have an excell file on the
server wich i have created a link to on the web site. when u click the link the
browser lets you save it or open it, but it only lets you open it through the
browser(automation takes place.. where an instance of excell runs in the
browser container)

How do i get the file to open in an seperate instance of excell?

7 replies

by joe giaquinto

Hi Carol,

These examples might help. Adapt and/or combine the code as needed. ASP will run on the server by default but you can specify it to run on the client (RUNAT directive). HTML runs on the client the same as Java.

The key to this puzzleis that Word must be installed on the server and/or client, and you must call it as an automation object (like you would in VB/VBA) so that you can manipulate its objects, methods and properties.

Code sample #1 (I tested this one)
Adapted from Greg Buczek's Instant ASP scripts by McGraw Hill
<%@ Language=VBScript %>
<%
if not isempty(Request.Form("Submit")) then
Set objWord = createobject("Word.Application")
With objWord
.Application.Documents.Open "c:\inetpub\wwwroot\teachmepc\test.doc"
.Visible=True
End With
Set objWord = Nothing
End if
%>

Test

Code sample #2
Source: MS Knowledge Base Article #Q178/2/22, HOWTO: Launch Word from Internet Explorer

Launch Word

by joe giaquinto

If you have no access whatsoever to the visitor's machine before they visit your site:

Create an ActiveX control that contains the code necessary to perform your requested operations. The ActiveX control would be installed on your server page andIE would ask the visitor if he or she wants to download this control to their local machine. The control runs on the client.

Or, use a Save-As dialog with IE scripting inside the browser to save an open workbook to the client computer. This process would be similar to using File-Save-As in the browser menu, or right-clicking the mouse on a picture and selecting Save-Picture-As.

Or, use the Office 2000 Excel Web component. It enables you to open a server-based Excel file for collaborationand save it to your local machine. Each visitor must have a licensed copy of Excel 2k on their machine for the control to work. (You might want to investigate collaboration technology ? perhaps you can develop your own solution.)

If you do have prior access to the visitor's machine before they visit your site (on a corporate Intranet) or will enable your visitors to download a VB app beforehand:

Use an Excel Web query that runs in VB/VBA on the client's machine. Samples are available at Microsoft?s MSDN site.

Or, use a web browser control in your VB application, navigate to the URL where your server-side workbook is located, open Excel (via automation in VB), and copy the contents over from the page and save it. (You could also drill down to the Excel object in the web browser control.)

Or, screen-scrape the HMTL page that displays your server-side Excel workbook by using a local VB application to parse data from your Web page.

by carolshafir

My problem is that the file is located on the server and the task is to tranfer the file over the internet into a client-side instance of excel. How would I do that, the info that you send me is already assuming that the file is on the users hard disk.
Another question would be how would I create a directory on a client machine and save a file to that directory withought prompting for any questions. (ie: bypassing the default dialogue box open or save file)

by geoffreyc

As far as I am aware, you will not be able to open an instance of excel outside of the browser, due to the security model of the world wide web. If you were able to do so it would be equally as simple for someone to open an instance of the Format utility and use that on the client's hard drive.

You will have to settle for in-browser excel, or getting the client to save it to disk and then open it manually.

I could be mistaken of course....

This discussion is closed to new replies.