class factory cannot supply requested class - VB6

Posted on 2006-04-23
Last Modified: 2008-01-16
I use a dll ( assume it is a c++ ) within my VB6 program.

I can use the class when I do early binding. But if I do late bind,

I get this error on the following line.

Set oOutPymnt = CreateObject("SAPbobsCOM.Payments")

"class factory cannot supply requested class"

I will be able to give more infor if needed.

Thanks in advance.

Question by:indikad
    LVL 26

    Accepted Solution

    are you sure the prog id is correct?
    How do you define oOutPymnt?

    Author Comment

    I worked it out. But your comment made me think that I could be actually doing something wrong. points given. for your interest here is the code.

    'early bind

    Dim oOutPymnt As SAPbobsCOM.Payments
    Set oOutPymnt = gObjCompany.GetBusinessObject(oVendorPayments)

    'late bind
    Dim oOutPymnt As Object
    '---oVendorPayments = 46
    Set oOutPymnt = gObjCompany.GetBusinessObject(46)

    I do not know how to technically explain why but,
    what I should not have is this following line.
    Set oOutPymnt = CreateObject("SAPbobsCOM.Payments")

    any ideas?


    as I said, I have awarded points.

    LVL 26

    Expert Comment

    that's mean you need to get object from them and cannot create object

    which imples that their object is not public createable

    Author Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    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…
    Article by: Martin
    Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
    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…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

    794 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

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now