Microsoft KB Archive/305528

= OFF2000: How to Distribute ActiveX Controls =

Article ID: 305528

Article Last Modified on 7/16/2007

-

APPLIES TO


 * Microsoft Office 2000 Premium Edition
 * Microsoft Office 2000 Professional Edition
 * Microsoft Office 2000 Small Business Edition
 * Microsoft Office 2000 Standard Edition
 * Microsoft Office 2000 Developer Edition

-



This article was previously published under Q305528



SUMMARY
When you create and distribute a Visual Basic for Applications (VBA) program that includes a Microsoft ActiveX control, you also need to distribute the ActiveX control. This article explains how to distribute ActiveX controls.



MORE INFORMATION
Microsoft provides programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes that you are familiar with the programming language being demonstrated and the tools used to create and debug procedures. Microsoft support professionals can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific needs. If you have limited programming experience, you may want to contact a Microsoft Certified Partner or the Microsoft fee-based consulting line at (800) 936-5200. For more information about Microsoft Certified Partners, please visit the following Microsoft Web site:

https://partner.microsoft.com/global/30000104

For more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site:

http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS

When you distribute a VBA form with an ActiveX control and then attempt to use the distributed form on the new computer, you may receive an error message similar to either of the following:

Object not found.

There is no object in this control.

This issue occurs when the ActiveX control is not correctly distributed to the new computer. Design-time ActiveX controls for developers are available either from Visual Basic or the Office Developer Edition. Both provide a Setup Wizard to package an Office solution for distribution. It is a common mistake of Office solution developers to distribute Office documents that reference an ActiveX control without properly distributing the control.

When you distribute an ActiveX control with your runtime application, include the .ocx file for the ActiveX control and any .dll files or other supporting files that are needed by the control.

To make this easier, the Package and Deployment Wizard supports the use of dependency (.dep) files. The .dep file for an ActiveX control contains information that specifies the files that are required to use the control. Each ActiveX control that is supplied with Microsoft Office 2000 Developer (MOD) has a corresponding .dep file.

Distribute ActiveX Controls with Visual Basic
When you distribute an Office solution that uses ActiveX controls, it is necessary to distribute runtime versions of the control. One way to do this is to create a sample Visual Basic application that references the control, and then use the Package Deployment Wizard in Visual Basic to properly distribute the runtime version of the control and properly register the control.

Create Sample Visual Basic Application with Control

 * 1) Start Visual Basic, and then create a new Standard.exe project.
 * 2) If your control is not visible on the Toolbox, right-click the Toolbox, and then click Components. On the Controls tab, click to select the check box next to your control, and then click OK.
 * 3) On the Toolbox, double-click your control.
 * 4) On the File menu, click Save Project, and then click Save twice.
 * 5) On the File menu, click Make Project1.exe, and then click OK.
 * 6) On the File menu, click Exit.

Use Package and Deployment Wizard to Distribute Control

 * 1) Start the Package and Deployment Wizard.
 * 2) Click Browse, select the project, and then click Open.
 * 3) Click Package.
 * 4) Click Standard Setup Package, and then click Next.
 * 5) Select a location in which to save the package, and then click Next.
 * 6) If you are prompted about missing dependency information, click to select the check box next to your control, and then click OK.
 * 7) Click Next, select any options for the size of the .cab files, and then click Next.
 * 8) In the Installation title box, type a title for the setup program, and then click Finish.
 * 9) Quit the Package and Deployment Wizard.

The .cab files, Setup.exe file, and Setup.lst files can now be used on other computers to install and register your ActiveX control.

NOTE: After Setup has been run on a non-developer computer, you cannot create another ActiveX control of the same type that was distributed. This is by design, because only the runtime version of the control has been registered.

Distribute ActiveX Control After Upgrades
When you reference an ActiveX control from VBA, and then upgrade to a newer version of the control, you need to re-reference the ActiveX control on a form before you try to distribute the application. This ensures that the design version of the ActiveX control matches the runtime version. For example, if your ActiveX control was installed with Visual Basic 5.0, and you then upgrade to Visual Basic 6.0, you should re-reference the ActiveX control.

For additional information about how to distribute ActiveX controls, click the article numbers below to view the articles in the Microsoft Knowledge Base:

279029 MOD2000: Supporting Files for ActiveX Controls in Microsoft Office 2000 Developer

197988 HOWTO: Deploy an ActiveX Control with the Package and Deployment Wizard (PDW)

247957 SAMPLE: Using DUPS.exe to Resolve DLL Compatibility Problems

For additional information about the Package and Deployment Wizard in Office 2000 Developer, see the following Microsoft Web site:

http://msdn2.microsoft.com/en-us/library/aa164840(office.10).aspx

For additional information about how to distribute controls, see the following Microsoft Web site:

http://msdn2.microsoft.com/en-us/library/ms811694.aspx

Additional query words: OFF2000

Keywords: kbhowto KB305528

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.