|
 |
javascript thread: Error with loading Excel file
Message #1 by tberry@v... on Tue, 26 Nov 2002 18:48:58
|
|
----- Original Message -----
From: "Jerry Scannell" <JerryScannell@c...>
To: "javascript" <javascript@p...>
Sent: Friday, November 29, 2002 5:33 PM
Subject: [javascript] Re: Error with loading Excel file
> Joe,
>
> The Excel file is currently in a directory off of the website's directory
> (inetpub\wwwroot\smld\temp\xxx.xls) In my open statement, I am currently
> using: xls.Workbooks.Open "temp\xxx.xls", xlReadWrite, False
>
> I have tried several different combinations including
> inetpub\wwwroot\smld\temp\xxx.xls, \temp\xxx.xls. I am always able to
open,
> modify, and save the file. I just can't make it visible of print it.
>
> I will try setting DisplayAlerts to false. I will have to test it on
Monday
> when I return to work.
>
> If there is a default printer setup, will PrintOut use it without
prompting?
> To avoid a popup prompt, is there a method to call that forces a
particular
> printer to be used? perhaps one installed on the client machine? Printing
> to the client machine is what my users would want anyway. They probably
> won't be anywhere near the server when they are running this.
>
> I didn't see the link you provided before. I just went to it and printed
> out the info. I am about to read it now. Thanks.
>
> Jerry
Well we seem to be at cross purposes, let's start again:)
Aside from the fact that you started running this with PWS when I suspect
that the server and client were the same physical machine you are normally
going to have a server running server side code, in your case ASP delimited
by <% %> and a client (browser) running client side code delimited by
'script' blocks.
It appears that you wish to open an Excel spreadsheet on the client and
print it, the actual file residing on the server.
If you intend to force the file to open in Excel and use a built in method
to print it you are going to run into security restrictions. You can only
force the file to open in Excel by either modifying the client's registry or
manipulating Excel via OLE automation, both of which require the client to
agree at some stage to you running very unsafe code on their machine.
You may get away with loading the Excel file into an iframe or normal frame
and then calling the print method on the frame. I'm not sure if this will
give the same effect as calling the printOut method as I'm not very familiar
with Excel. It will need the client to have Excel installed on their
machine.
If any of these options is viable for your circumstances then let me know
and I'll run through the code with you.
Good luck
Joe
|
|
 |