Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

FIX: Visual Basic 6 .0 UserControl in Excel Does Not Print or Display in Print Preview


View products that this article applies to.

This article was previously published under Q249607

↑ Back to the top


Symptoms

When you attempt to Print or Print Preview an Microsoft Excel 97 or Microsoft Excel 2000 workbook containing a UserControl that was created in Visual Basic 6.0, the UserControl does not print or display in the Print Preview window.

The problem does not occur when using the UserControl in other Microsoft Office applications. The problem does not occur with a UserControl created in Visual Basic version 5.0.

↑ Back to the top


Status

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. This bug was corrected in the latest service pack for Visual Studio 6.0.

For additional information about Visual Studio service packs, click the following article numbers to view the articles in the Microsoft Knowledge Base:
194022� INFO: Visual Studio 6.0 Service Packs, What, Where, Why

194295� HOWTO: Tell That a Visual Studio Service Pack Is Installed
To download the latest Visual Studio service pack, visit the following Microsoft Web site:

↑ Back to the top


More information

Steps to Reproduce Behavior

  1. In Visual Basic, create a new ActiveX Control project. Project1 is created by default. UserControl1 is added by default.
  2. Change Project1's Name property to prjTestExcel. Change UserControl1's Name property to ctlTestExcel.
  3. Add a Label control to UserControl1. Label1 is created by default. You do not need to modify Label1's default properties any further.
  4. Save the UserControl as ctlTestExcel.ctl. Save the Project as prjTestExcel.vbp.
  5. Compile the Project to prjTestExcel.ocx. Exit from Visual Basic.
  6. Start Microsoft Excel version 97 or 2000. Book1 is opened by default.
  7. From the View menu in Excel, click to select Toolbars. From the list of available Toolbars, click to select Control Toolbox.
  8. At the bottom of the Control Toolbox, click the More Controls icon. From the list of More Controls, select prjTestExcel.ctlTestExcel. Drag in Book1 to draw an instance of the UserControl in the workbook.

    NOTE: If the UserControl is not in the list of More Controls, do the following:
    1. Select Register Custom Control from the list of More Controls.
    2. Navigate to the OCX file in the Register Customer Control dialog box.
  9. Once the UserControl has been placed and sized on the form, select to either Print or Print Preview the workbook. Note that the UserControl does not appear on a printout and the UserControl does not appear in the Print Preview window.

↑ Back to the top


Keywords: KB249607, kbvs600sp5fix, kbvs600sp4fix, kbfix, kbctrl, kbbug

↑ Back to the top

Article Info
Article ID : 249607
Revision : 5
Created on : 8/7/2007
Published on : 8/7/2007
Exists online : False
Views : 361