class factory cannot supply requested class - VB6

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.

Who is Participating?
are you sure the prog id is correct?
How do you define oOutPymnt?
indikadAuthor Commented:
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.

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

which imples that their object is not public createable
indikadAuthor Commented:
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.

All Courses

From novice to tech pro — start learning today.