"ActiveX component can't create object" error message when you run code that calls the Common Dialog Control (Comdlg32.ocx)

Article translations Article translations
Article ID: 281848 - View products that this article applies to.
This article was previously published under Q281848
Expand all | Collapse all

SYMPTOMS

When you run code that calls the Common Dialog Control (Comdlg32.ocx) on a computer other than the one where the code was developed, you may receive the following error message:
Run-time error 429: ActiveX component can't create object.

CAUSE

This problem can occur if the following conditions are true:
  • The control is called from Visual Basic for Applications code by using the New CommonDialog command.
  • The computer from where you are running the code has a run-time license instead of a design-time license for this control.
With a run-time license, you can load the control, but you cannot create or insert it. The design-time license for this control is included with the Microsoft Office 2000 Developer Edition, Microsoft Visual Basic 6.0, and Microsoft Visual Studio. It is not included with other versions of Microsoft Office 2000.

WORKAROUND

To work around this problem, wrap the control inside another control, such as a UserForm. To do this, follow these steps:
  1. In the Visual Basic Editor, add a UserForm to your project.
  2. Insert a common dialog control on the UserForm. For example, use the following code to call the common dialog control on the UserForm:
       Sub test()
         UserForm1.CommonDialog1.ShowOpen
       End Sub
    					
  3. Save the workbook.
Because the control is wrapped in the UserForm and it resides inside the project, you can now call it in run-time mode.

Properties

Article ID: 281848 - Last Review: January 29, 2007 - Revision: 4.3
APPLIES TO
  • Microsoft Project 2000 Standard Edition
  • Microsoft Excel 2000 Standard Edition
  • Microsoft Access 2000 Standard Edition
  • Microsoft Word 2000 Standard Edition
  • Microsoft Outlook 2000 Standard Edition
  • Microsoft PowerPoint 2000 Standard Edition
  • Microsoft Visio 2000 Standard Edition
Keywords: 
kbprogramming kbtshoot kbdtacode kberrmsg kbprb KB281848

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com