• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1172
  • Last Modified:

Using a COM with VB.Net

I am trying to use a COM with VB.Net and it sounds like I need to create a "wrapper" to use it.I read the article here:

http://www.csharphelp.com/archives2/archive437.html

but Im still having problems.  When I go to the command prompt and try to run  tlbimp.exe it doesnt work.  When I type in "tlbimp" it says "'tlbimp' is not recognized as an internal or external command, operable program or batch file".  I do however have it on my machine.

HEre is the code I am running in my program, which is generating COM exceptions.  

Imports System
Imports busobj
Imports System.Runtime.InteropServices

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        Dim BusObjApp As New busobj.Application
        Dim BusObjRep As New busobj.Report

When I try to create the new business objects report I get the COM exception.

"Retrieving the COM class factory for component with CLSID {2AE0D397-5F2A-11D0-8B75-0000C0FDEBE3} failed due to the following error: 80040154."

I've been stuck on this for a while now....and ideas would be greatly appreciated.


0
collages
Asked:
collages
  • 4
  • 4
2 Solutions
 
Bob LearnedCommented:
1) What version of 2005 do you have?  Express Edition, Professional, Team Suite?

2) Where was the COM component created?

Bob
0
 
collagesAuthor Commented:
I am running VB 2005 express.

The COM component is part of Business Objects 6.1.  I am trying to automate running reports.  The COM is the busobj import in the code I posted.  It is called "BusinessObjects 6.0 Object Library".
0
 
Bob LearnedCommented:
You should be able to add a reference to a COM through the 'Add Reference' dialog box.  .NET will create the wrapper class for you automatically (Interop.dll).

Bob
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

 
collagesAuthor Commented:
Ok...maybe I have another problem then.  I added the reference and have the following code right now:

Imports System
Imports busobj
Imports System.Runtime.InteropServices

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        Dim BusObjApp As New busobj.Application
        Dim BusObjRep As New busobj.Report

But when I try to create the new report I get the COMException.  

Is there something wrong with my code, or does this look like another problem?
0
 
Bob LearnedCommented:
1) The underlying COM library isn't installed.

2) ActiveX cannot create object.

Bob
0
 
collagesAuthor Commented:
How do I check to make sure the COM library is installed?  I think it is becaise I can run the application (Business Objects) just fine.

0
 
Bob LearnedCommented:
There is a convoluted way, by looking through the registry under HKEY_CLASSES_ROOT\CLSID for the {2AE0D397-5F2A-11D0-8B75-0000C0FDEBE3} GUID.

Bob
0
 
SanclerCommented:
I wonder if there is a license issue here?  Although the error numbers are supposed to be different - 80040154 for not registered and 80040112 for not licensed - I seem to recall facing, or reading about, an 80040154 error being reported when, although the relevant files were on, and registered on, the system concerned they were only licensed for direct USE and not for inclusion with or reference by a developed applicant.  Sorry, I can't remember more details, and a quick Google hasn't sparked any more specific memories.  But it's an angle you might like to consider.

Roger
0
 
collagesAuthor Commented:
Well, I think this might be my own noobness (is that word?) at work here.

Instead of creating a new report I noticed I have the option to create a new document.  Well, I created that and it doing everything I need it to do.

I dont have any documemtation on the business objects library so Im kind of poking in the dark here, but for now I think im cool to move forward.  Thanks for your help guys.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now