The code I posted in does not seem to have come through in the mail, unless
you use the view the post in a browser. To fix this I've added the info to
my site at the URL below.
At 13:37 19/01/03 +0000, you wrote:
>I think the issue is the order in which the functions are called,
>rearranging this and adding some other code from
>http://www.greggriffiths.org/webdev/both/excel/ gives me a working
>solution on IE 6 :
>
>
>At 14:12 16/01/03 -0500, you wrote:
> >Joe,
> >
> >I may not have made this point clear. The code works properly on another
> >windows 2000 server (the one that I had all the problems with initially in
> >the Fall). I moved the code to another machine and it doesn't work
> >there. It has something to do with the server's configuration. I went
> >through everything I could recall and the stuff works at about 95% which
> >is a major milestone considering what I went through in the fall with the
> >first server!
> >
> >The line that fails is the page setup commands for landscape or paper size
> >(see below). It just tells me that I can't change the property (it
> >doesn't say why, of course!)
> >if I comment out the lines the visible = true works and I can view the
> >file, change any page setups, print it, whatever I want.
> >
> >The help I had received before, mentioned configuring the "Local intranet"
> >with the "custom level..." button to allow Active-X components that are
> >thought to be unsafe. I did that. That configuration property, if not
> >"Enabled", won't even allow the opening of an excel object. So the error
> >would have occured on the first line in the script.
> >
> >
> >There was another tip where I had to do Start | Run
> >and enter in come system command, run it and set/change something. I
> >might need to do that but I don't have a record of the command's name and
> >what to edit!
> >
> >
> >Might I also need to upload something from Microsoft? Active-X objects or
> >something?
> >
> >Hopefully you can help me.
> >
> >Thanks,
> >Jerry
> >
> >
> >Here's the code again:
> >
> >function viewExcel()
> >{
> > var xls = new ActiveXObject ( "Excel.Application" );
> > var handle = xls.Workbooks.Open( "<%=strJS_ExcelFile%>",
> > <%=xlReadWrite%>, false );
> >
> > xls.ActiveWorkBook.ActiveSheet.PageSetup.Orientation = <%=xlLandscape%>;
> > xls.ActiveWorkBook.ActiveSheet.PageSetup.PaperSize =
> <%=xlPaperLegal%>;
> >
> > xls.ActiveWorkbook.Save (); // Do this so the user can just exit
> > if he wants to.
> >
> > xls.visible = true;
> > return true;
> >}
> >
> >The ASP variables are
> >strJS_ExcelFile which is the name of the file (which is correct or else I
> >wouldn't be able to see the xls file)
> >
> >NOTE: The ASP constants are defined in an include file as follows:
> >
> >Const xlReadWrite = 2
> >Const xlLandscape = 2
> >Const xlPaperLegal = 5
> >
> >
> >
>
>
>
>