[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

activex can't create object error

Posted on 2000-03-22
8
Medium Priority
?
187 Views
Last Modified: 2013-11-26
hello everyone.

I have this problem with my activex component. When i create an instance of
it,  it generates an error - activex component can't create object. What
does this mean? it's  weird since my older version of this component works
perfectly. Additional info. I used VB 6.0 sp3 to create this component. It
uses excel 97 component to manipulate excel files. Now my system has two
versions of excel 97 and 2000. My system is windows nt sp5.

0
Comment
Question by:HokSun
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 2645087
Maybe post some of the code (Lines with the DIMs and the Lines with CREATEOBJECT or NEW)
This will help to answer precisely
0
 

Accepted Solution

by:
ivysoft earned 150 total points
ID: 2645165
U are getting the error while creating the instance of ur component
Two options
1) Either Ur component is failing.
2) The Excel is failing.
Since u havent mentioned i assume, u are getting this error while doing
createobject("MyComponent") or
Dim oMC as new MyComponent

Again there are two possiblities
a) If u are instantiating Excel in the Class_Intialize event of Ur component and if there isnt any error handling and if Excel fails to instantiate, u can get this error.
b) Ur component itself fails to instantiate.

If a) doesnt apply ur component is failing.

So what u need to do is check the compatibility of the new component to the previous working version by setting binary compatibility. Recompile and make the new component again. if it breaks the compatibilty, then u will need to reference this new component again in the application U R using and it will work fine.

Or

if a) applies then u need to catch the error in the class_intialize and check if excel is failing. U need to check the excel references if they are available or not.


Hope this helps.

Brij

N.B : - Run regclean on ur machine so that corrupt class ids are removed.
0
 
LVL 1

Author Comment

by:HokSun
ID: 2648002
Hi, thanks for your comment. to answer your question  ivysoft:

the error occurs on NEW command.

I did not instantiate the excel object in the class_initialize event

I've already recompiled the project but the component created has this bug or error. This is same project i created before without error, so i suppose the error has nothing to do with my codes.

But i've debugged the project in  another machine which has only excel 2000 in it, during the debugging mode where i Run the main project and component project, there was no error . This time the main project references the component project not the dll i created earlier.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:HokSun
ID: 2648016
In addtion to my previous comment,

but when i make a dll in this another machine and register it so that my exe program will use it, when the exe program runs and use the component an error happens (activex component can't create object). In short, during the debugging mode where i use the exe project and component project in vb, i can run exe project without error. but when i compile the component to dll, the exe program could not use it correctly.
0
 

Expert Comment

by:Ardman
ID: 2648481
Hi,
I've been working a lot with ActiveX over the past couple of months. I have had the same error as you have. Maybe you could post some code examples or email direct.

Neil
0
 

Expert Comment

by:ivysoft
ID: 2649581
Compile the component and add to the references and try iton the machine on which U dont get the errors and test it at run time.

Brij
0
 
LVL 1

Author Comment

by:HokSun
ID: 2652961
ivysoft,

i've also tested it at run-time on the machine where the error does not happen at design time.  But the error is still there at run-time.
0
 

Expert Comment

by:ivysoft
ID: 2653558
So this is definitely compatibilty problem. I suggest remove all component references from Ur project. Unregister all versions. Run RegClean. reregister previous component. Then recompile with binary compatibility set. And try it at run time.

Brij
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question