PRB: Pasting from OLE Client Puts Graphic in Clipboard

Last reviewed: November 29, 1995
Article ID: Q140204
The information in this article applies to:
  • Standard, Professional, and Enterprise Editions of Microsoft Visual Basic, 16-bit and 32-bit, for Windows, version 4.0
  • Standard and Professional Editions of Microsoft Visual Basic for Windows, version 3.0

SYMPTOMS

After copying part of an embedded OLE object, and pasting the contents of the clipboard to the form while the form has the focus, a graphic representing the object is inserted onto the background of the form.

CAUSE

When you copy certain OLE objects from an OLE container, more than one form of information is copied to the Clipboard. For example, when you copy cells from an Microsoft Excel spreadsheet, objects in both bitmap and enhanced metafile format (among other objects) are copied to the Clipboard. Then when the object is pasted onto a Visual Basic form it causes the form's Picture property to be set to the bitmap of the copied cells. There is no way to position or manipulate the image if it is added to form in this manner.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Problem

  1. Start Visual Basic 4.0, or if it is already running, click New Project on the File menu.

  2. Double-click on the OLE Client control in the toolbox to add a new OLE client to your project. When the Insert Object dialog box appears, select "Microsoft Excel Worksheet" and click OK.

  3. Type some text into the cells of the embedded worksheet. Select the filled in cells and click Copy (or press CTRL+C) on the Edit menu to copy the cells to the Clipboard.

  4. Click a location on the form that is not covered by the OLE control. Press CTRL+V to paste the contents of the Clipboard to the form. The result is a representation of the cells in the upper left-hand corner of Form1. If the Picture property of the form is examined, it no longer is the default "None," instead it is the value "Bitmap."


KBCategory: KBOLE
KBSubcategory: IAPOLE
Additional reference words: 4.00 vb4all vb4win



THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: November 29, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.