Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: SV: Excel objects from JavaScript


Message #1 by "Robert Nyman" <robert.nyman@c...> on Thu, 16 Jan 2003 09:52:33 +0100
Try looking in the JavaScript archive:

http://p2p.wrox.com/archive/javascript/


/Robert


-----Ursprungligt meddelande-----
Fr=E5n: Jerry Scannell [mailto:JerryScannell@c...]
Skickat: den 15 januari 2003 21:48
Till: javascript
=C4mne: [javascript] Excel objects from JavaScript


A few months ago I posted to this forum pertaining to integration
problems with ASP, Excel, Windows 2000 Server.

Someone replied to me with the proper fix.  Somewhere along the way I
deleted that eMail response and I need the reply again.

If you are out there, please reply to this with the fix that takes care
of proper client-side manipulation of an Excel object.  I have already
enabled the Active-X components by double-clicking "Local intranet"
clicking the "Custom level... " button, and enabling "Initialize and
script Active-X controls not marked as safe"

I am not able to modify the Orientation property of the Excel object.
Here's the code I'm trying to run.  The variables surrounded by 
<%=3D...%>
are, of course, ASP variables and are correct.  This code runs on
another Windows 2000 Server that has already been massaged to work.  If
you recall, I had a ton of trouble getting this all to work back in
October.  Now I have to do it on another server and don't have the
documentation anymore.

<script language=3D"JavaScript">

function viewExcel()
{
   var xls    =3D new ActiveXObject ( "Excel.Application" );
   var handle =3D xls.Workbooks.Open( "<%=3DstrJS_ExcelFile%>",
<%=3DxlReadWrite%>, false  );

   xls.ActiveWorkBook.ActiveSheet.PageSetup.Orientation =3D
<%=3DxlLandscape%>;
   xls.ActiveWorkBook.ActiveSheet.PageSetup.PaperSize   =3D
<%=3DxlPaperLegal%>;

   xls.ActiveWorkbook.Save ();      //  Do this so the user can just
exit if
he wants to.

   xls.visible =3D true;
   return true;
}

</script>

Thanks,
Jerry





  Return to Index