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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

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

Status
Not open for further replies.

ppepin

IS-IT--Management
Mar 13, 2001
36
US
Well, I know i've seen some threads on this, but I need to post this one again because everything I try doesn't seem to work.

This is my situation. I am running Windows 2000 Advanced Server (No service pack), IE 5.5 (Service Pack 1), the updated Windows Scripting Host (5.6) and Microsoft Office 2000. When I try to create an Excel file using the ActiveX control, I get the following error:

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

When I run this on a Win98 machine with Office 2000 installed, the code works fine. It will not run on ANY 2000 machines, Advanced Server or just Windows 2000 Workstation.

This is my code:

<script language='vbscript'>
Set objXL = CreateObject(&quot;Excel.Application&quot;)
objXL.Visible = TRUE
objXL.WorkBooks.Add
objXL.Columns(1).ColumnWidth=80
objXL.Cells(1,1).value = &quot;HELP!!!!!!&quot;
</script>

Can somebody please end my suffering!
 
Hope this helps.

When you do a set objXL = CreateObject(&quot;Excel.Application&quot;) and type objXL. the intelli-sense does not come on. For most of the components I use the intelli-sense comes on and exposes the methods and the properties.

<%
Dim objXL

Set x = createobject(&quot;HRM2001.CurrentJob&quot;)
x. ' This exposes my properties and methods

 Set objXL = CreateObject(&quot;Excel.Application&quot;)
objXL. ' doesnot
    objXL.Visible = TRUE        
    objXL.WorkBooks.Add
    objXL.Columns(1).ColumnWidth=80
    objXL.Cells(1,1).value = &quot;HELP!!!!!!&quot;
%>    

Could be a registration of components issue.

Just punching at the air here.

Delton Phillips.
New Generation Solutions

ngs@cwjamaica.com
deltonphillips@hotmail.com

New thinking....better results.
 
Is there any extra information in the Event Log concerning the failure to create the object?

A suspicion would have to be that there are som COM/DCOM permissioning issues on the W2000 box. Entries in the event log may help to confirm or deny this.
 
I have sometime a similar problem with CreateObject(&quot;Scripting.FileSystemObject&quot;). I didn't solve the problem - but for the sake of the program I lowered the security in the browser to minimum and everything worked fine.

I mention that I didn't have this problem when I user Server.CreateObject(&quot;Scripting.FileSystemObject&quot;) in ASP

Hope of being of some help, s-) Blessed is he who in the name of justice and good will, shepards the week through the valley of darknees...

 
There are no entries in the event log for my application. I was hoping there would be, but there is nothing.

Any other suggestions?

 
Well, thanks for everybody's help. After 3 weeks of jerking around with this, it appears as though it was a security issue.

How I resolved this:

I changed the ActiveX options on the Intranet Zone of IE 5.5 from enabled to prompt. Then, the next time I ran my application, IE prompted me if I really wanted to run ActiveX controls. When I responded yes, all worked fine. And still works fine every time I try it.

Thanks everyone!
 
I told you that if you lower the security, your program will work. But this does not solve the problem because you cannot go to the client that uses your program and tell him to lower the security(this implies other risks)

This is just a workaround.
Anyway now you can make your program functional and than you can think again about this aspects.
s-)

Blessed is he who in the name of justice and good will, shepards the week through the valley of darknees...

 
I have to disagree with you, I didn't lower the security.

If you go into IE 5.5, go to the security tab and then to custom levels, the first 5 options are for ActiveX controls. Some say enable, disable and prompt. It appears as though when one of the options says enabled, it is actually working like disabled was selected. What I did was set them all to prompt, then I ran my application and it worked fine, but I got several IE prompts, (Do I want to run ActiveX controls, ActiveX controls don't interact with the desktop, etc). Then I set them all back to enabled and my application still worked fine. Haven't narrowed down which option was in error, because now that I have changed them, things are working like they should.

Thanks for your help in pointing me towards the solution.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top