p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

proasp_howto thread: Launch of MS-Excel 2000 (fails) vs. MS-Excel 97 (works)


Message #1 by Darren Wogan <darrenw@s...> on Thu, 8 Jun 2000 09:51:58 +0100
Hi,

I use the following code to launch MS-Excel from within a web page. 

This launches MS-Excel 97 with no problem (providing the Browser Security
settings are set to 'Initialise and script ActiveX controls not marked as
safe'). However when the client machine has MS-Excel 2000 installed nothing
happens. 

Is there an alternative means required to launch MS-Excel 2000? Has the
context been changed?

(Curiously enough when I put the same code into a '.vbs' file and run it on
the same Excel 2000 client machine it DOES launch Excel successfully.)

	<script language="VBScript">
	<!--//
	    '###
	    '# Launch MS-Excel Application
	    '###
	    Function openMSExcel()
	        Err.clear    
	        On Error Resume Next

	        Set objApp = CreateObject("Excel.Application")
	        if Err then
	            Err.clear
	            msgBox("Microsoft Excel launch failed - Please check
Excel installation")
	        else
	            objApp.Visible = True
	            On Error Resume Next
	            objApp.WorkBooks.Add

	            if (Err.number <> 0) then
	                msgBox("Microsoft Excel access failed - Please check
Excel installation")
	            end if
	        end if
	    End Function
	-->       
	</script>

--------------------------------------------------
Darren Wogan, Consultant
mailto:darrenw@s...
--------------------------------------------------
Strategic Thought Ltd.
The Old Town Hall,
4 Queens Road,
Wimbledon,
London,
SW19 8YA.
Tel: +44 (0)20-8410 4000
Fax: +44 (0)20-8410 4030
http://www.strategicthought.co.uk
--------------------------------------------------
http://www.arm-risk.com
--------------------------------------------------



  Return to Index