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.Application "ActiveX cannot create component: Excel". 1

Status
Not open for further replies.

delorfra

Programmer
Mar 8, 2001
79
FR
Hi,

When trying to use the Excel.Aplication object in ASP, I encountered the same problem as a lot of people that is the "ActiveX cannot create component: Excel" error message.

I read in one thread that :

"you'll need to create an activeX dll and register it in MTS to run and create the excel file...
check this article on how to do it..:
"

1° Is it really the solution ?
2° If yes, is there any other ressource on that because I am not ready to fork out 99 bucks just to read one article.
3° If there is any simpler solution, what is it ?

=> I want to fill out an Excel form, writing data imported from a database in specific cells so that users can then complete the missing data remaining to be specified before printing the document.

Thanks
 
Hi delorfra,

If you're sole purpose is to automate the creation of an Excel file on the server, the following may not be much help. (Although it can be if you're willing to get very intimate with the FileSystemObject)

But if your goal is to dynamically create and send an Excel file to a visitor currently on your website. Read on !!

Read this Helpful Tip. (But not before you read all of this reply)

thread333-151169

It has links to three very valuable Microsoft articles regarding Excel and ASP.

I like articles #1 and #2, because it allows you to stream Excel content directly to the browser by specifying the excel content type. I like it because it doesn't require any automation which will let you sleep more at night. Both of these methods will launch Excel on the client machine and place the data into a single Worksheet (Article #1) or a formatted Workbook (Article #2). You're only challenge may be that you won't know wheter or not the client's computer will prompt them to save the file first, launch Excel inside the browser window or launch Excel outside the browser window. But you can be assured that it will be one of those three things.

The only time I use Excel automation is if (a) I need to automate Excel to create a chart or graph AND (b) I know the user is using Microsoft IE. Article #3 in that thread goes into this in great detail including the fix for the all elusive Active X error.

Now, anytime you want to pursue one of the three solutions, I would highly recommend that you take Microsofts advice and run the sample code on your server just to see it work. Make sure it's going to do what you think it's going to do. You might not be able to (or want to) create a connection to a database for data like they do, so remove their data connection lines and recordset functions and replace it with static content.

Hope this helps ..

ToddWW
 
Thanks a lot ToddWW !!!

You have ended a 2 days search over the web.

While I was surfing through the links in the thread you mentionned, I happened to come across a MSDN article :

"PRB: CreateObject Fails from Client-Side Scripts"

Excerpt :

"RESOLUTION
To resolve this problem, follow these steps on the client computer:

1 Start Microsoft Internet Explorer.
2 From the Tools menu in Internet Explorer 5 or the View menu in Internet Explorer 4.0, select Internet Options.
3 Click the Security tab.
4 Select Custom (for expert users), and click Settings.
Under the Initialize and script ActiveX controls not marked as safe option, change the setting from Disable to Prompt. This prompts users to initialize the object.
5 After you change the setting to Prompt, the CreateObject call should succeed. Internet Explorer will prompt the user about whether it should initialize the object. To eliminate the dialog box, you can change the setting in step 5 from Prompt to Enable."

Thanks Again.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top