Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel

Status
Not open for further replies.

HotBob

Programmer
May 26, 2006
37
GB
Hi there, hopefully not another Excel question but I have the folllowing code

Code:
           <form ACTION="<%=Request.Servervariables("URL")%>"  METHOD="Post" name="search" id="search" >             <%
Dim xls	
Set xls = CreateObject("Excel.Application")

with xls
.Application.Visible = TRUE           
.Workbooks.Add     				
.Sheets ( "Sheet1" ).Select
.ActiveSheet.Cells(1,1).Value = "Now isnt this fun"    
End With
%>

However, I get the error

Microsoft VBScript runtime error '800a01ad'

ActiveX component can't create object: 'Excel.Application'

Any ideas?

I'm using dreamweaver.
 
Is Excel installed on the server?

Why not use Server.CreateObject instead?
 
excel isn't installed on the server.

Any ideas?
 
If excel is not installed on the server then how can it be acessed by server-side script?

Perhaps this is something that can happen client-side if all your browser viewers have excel on their machines?
 
You definitely need Excel on the server for your script to work.

If at any moment you need to use the ".save" method and drop the excel document on a folder, you will also need to give the IWAM (IIS launch user) user write right on that folder.

I would rather write a VB6 dll, register it and use it as COM object. I found it to be much more efficient and fast.

For some reason the Excel object in ASP may leave several instances of Excel running on your server.

QatQat

Life is what happens when you are making other plans.
 
I agree with QatQat, it is easy to find yourself with a mysteriously slow web server... until you look at the Task Manager and see 25 copies of Excel running without any visible interface.
 
I installed excel onto the server and now nothing happens even if I place this code in a blank asp page.

Any ideas?

Code:
<HTML>

<HEAD>
</HEAD>

<body bottomMargin="0" leftMargin="0" topMargin="0" rightMargin="0" marginwidth="0" marginheight="0">
</body>
</HTML>

<%
Dim xls 
Set xls = server.CreateObject("Excel.Application")

with xls
.Application.Visible = TRUE 
.Workbooks.Add 
.Sheets ( "Sheet1" ).Select
.ActiveSheet.Cells(1,1).Value = "Now isnt this fun" 
End With

%>

Should this open up an instance of excel and populate it?
 
Where are you looking to see the application?

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
A long time ago i decided not to make spreadsheets by using Excel on the server. Slow and resource wasting. In almost all situations where i want XLS output, it is because the user must have the possibility to "play" with the data.
Excel is "rows and columns" and that is very compatible with a HTML table. Modern Excel can read a HTML table, and convert that automatically to decent XLS.
step 1. Program your outpiut as a table
step 2. debug
step 3. Put these line before the code:


Response.Contenttype="application/vnd.ms-excel"
Response.AddHeader "content-disposition","attachment;filename=MySheet.xls"

step 4. presto!

With inline style's you can make quite a colorful XLS if that's mandatory.



 
nothing would happen with your code other than putting an Excel file in memory.

You are not saving it or opening it to the end user


General FAQ faq333-2924
5 steps to asking a question faq333-3811
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top