devxlogo

ActiveX Can’t Create Which Object?

ActiveX Can’t Create Which Object?

When working on a large VB application that uses hundreds of COM objects, the “429 can’t create object” error doesn’t give you much help in determining which object could not be created. You can get around this limitation by writing a function to wrap the VB runtime CreateObject function:

 Public Function CreateObject(sProgID as string) _	as object	On Error Goto CreateErr	' Call the VB runtime CreateObject function	Set CreateObject = VBA.CreateObject(sProgId)	Exit FunctionCreateErr:	' return the error with the name of the object 	'that could not be created	Err.Raise Err.Number, _		"CreateObject Wrapper", Err.Description & _		": '" & sProgID & "'"End Function

With this wrapper function, you get the 429 error and the name of the object that could not be created.

See also  Why ChatGPT Is So Important Today
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist