+ Reply to Thread
Results 1 to 6 of 6

Clearing a copied Shape from the Clipboard with VBA?

  1. #1
    Forum Contributor
    Join Date
    09-21-2014
    Location
    Midwest USA
    MS-Off Ver
    2010
    Posts
    349

    Clearing a copied Shape from the Clipboard with VBA?

    Normally to clear the clipboard I use
    Please Login or Register  to view this content.
    However, this doesn’t work when I’ve copied a Shape in 2010. Anyone know how to clear the Clipboard of a copied Shape?

  2. #2
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Clearing a copied Shape from the Clipboard with VBA?

    Two ways:
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    09-21-2014
    Location
    Midwest USA
    MS-Off Ver
    2010
    Posts
    349

    Re: Clearing a copied Shape from the Clipboard with VBA?

    Thanks Kenneth – I appreciate the help. I got the first method to work perfectly. I’d like to understand the second one too. When I try that code I get a compile error “User-defined type not defined” on the line “Dim MyDataObj As New DataObject” of code. Any ideas?
    Thanks again for the solution.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Clearing a copied Shape from the Clipboard with VBA?

    Quote Originally Posted by aquixano View Post
    I get a compile error “User-defined type not defined” on the line “Dim MyDataObj As New DataObject” of code.
    Set a reference to Microsoft Forms Object Library.
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Forum Contributor
    Join Date
    09-21-2014
    Location
    Midwest USA
    MS-Off Ver
    2010
    Posts
    349

    Re: Clearing a copied Shape from the Clipboard with VBA?

    Thanks Shg - That fixed it. I would have never figured that one out. Is a list of those common References I should have turned on? Currently I have:
    Visual Basic for Applications
    Microsoft Excel 14.0 Object Library
    OLE Automation
    Microsoft Office 14.0 Object Library
    Microsoft Forms 2.0 Object Library (Just added)
    Also, I notice I can change the priority of an item up or down. Is there a preferred order to these items? Thanks for the assistance.

  6. #6
    Forum Expert Kenneth Hobson's Avatar
    Join Date
    02-05-2007
    Location
    Tecumseh, OK
    MS-Off Ver
    Office 365, Win10Home
    Posts
    2,573

    Re: Clearing a copied Shape from the Clipboard with VBA?

    It is best to just add the object references as needed per VBAproject. Order does not matter. I normally comment that a reference is needed which is why I had a comment to Chip Pearson's web site that explains that and more.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Web Query clearing pre clipboard.
    By Kris484 in forum Excel General
    Replies: 2
    Last Post: 11-22-2013, 04:32 AM
  2. clearing the clipboard
    By Stefi2000 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-26-2012, 07:52 PM
  3. Clipboard clearing
    By astrikor in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-03-2009, 07:28 AM
  4. Clearing clipboard with VBA
    By nickbarthram in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-29-2007, 07:25 AM
  5. Clearing the clipboard
    By Kevlar in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-22-2006, 06:20 PM
  6. Re: clearing the office clipboard in vba
    By gregschottland in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-28-2006, 06:25 PM
  7. [SOLVED] Clearing the clipboard
    By Avi in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-18-2005, 09:10 AM
  8. Clearing the clipboard
    By Greg Billinge in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-02-2005, 09:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1